+Wed Aug 6 13:24:00 CEST 2008 Chris Lalancette <clalance@redhat.com>
+ * src/xend_internal.c: Oops. My bug fix from yesterday broke the
+ regressions suite. We do actually need "(device" on the front of
+ the sexpr, but only if we are first creating the domain, not when
+ we are attaching a new disk. This patch fixes it by adding a flag
+ that we check, and allows the regression suite to pass.
+
Tue Aug 5 18:43:00 CEST 2008 Chris Lalancette <clalance@redhat.com>
* src/xend_internal.c: Fix three bugs related to virsh attach-disk:
a) make sure to break in the xenDaemonAttachDevice() in the switch
virDomainDiskDefPtr def,
virBufferPtr buf,
int hvm,
- int xendConfigVersion);
+ int xendConfigVersion,
+ int isAttach);
static int
xenDaemonFormatSxprNet(virConnectPtr conn ATTRIBUTE_UNUSED,
virDomainNetDefPtr def,
virBufferPtr buf,
int hvm,
- int xendConfigVersion);
+ int xendConfigVersion,
+ int isAttach);
static int
virDomainXMLDevID(virDomainPtr domain,
virDomainDeviceDefPtr dev,
dev->data.disk,
&buf,
STREQ(def->os.type, "hvm") ? 1 : 0,
- priv->xendConfigVersion) < 0)
+ priv->xendConfigVersion, 1) < 0)
goto cleanup;
break;
dev->data.net,
&buf,
STREQ(def->os.type, "hvm") ? 1 : 0,
- priv->xendConfigVersion) < 0)
+ priv->xendConfigVersion, 1) < 0)
goto cleanup;
break;
virDomainDiskDefPtr def,
virBufferPtr buf,
int hvm,
- int xendConfigVersion)
+ int xendConfigVersion,
+ int isAttach)
{
/* Xend (all versions) put the floppy device config
* under the hvm (image (os)) block
xendConfigVersion == 1)
return 0;
+ if (!isAttach)
+ virBufferAddLit(buf, "(device ");
+
/* Normally disks are in a (device (vbd ...)) block
* but blktap disks ended up in a differently named
* (device (tap ....)) block.... */
else
virBufferAddLit(buf, "(mode 'w')");
+ if (!isAttach)
+ virBufferAddLit(buf, ")");
+
virBufferAddLit(buf, ")");
return 0;
virDomainNetDefPtr def,
virBufferPtr buf,
int hvm,
- int xendConfigVersion)
+ int xendConfigVersion,
+ int isAttach)
{
if (def->type != VIR_DOMAIN_NET_TYPE_BRIDGE &&
def->type != VIR_DOMAIN_NET_TYPE_NETWORK &&
return -1;
}
+ if (!isAttach)
+ virBufferAddLit(buf, "(device ");
+
virBufferAddLit(buf, "(vif ");
virBufferVSprintf(buf,
if ((hvm) && (xendConfigVersion < 4))
virBufferAddLit(buf, "(type ioemu)");
+ if (!isAttach)
+ virBufferAddLit(buf, ")");
+
virBufferAddLit(buf, ")");
return 0;
disk = def->disks;
while (disk) {
- if (xenDaemonFormatSxprDisk(conn, disk, &buf, hvm, xendConfigVersion) < 0)
+ if (xenDaemonFormatSxprDisk(conn, disk, &buf, hvm, xendConfigVersion, 0) < 0)
goto error;
disk = disk->next;
}
net = def->nets;
while (net) {
- if (xenDaemonFormatSxprNet(conn, net, &buf, hvm, xendConfigVersion) < 0)
+ if (xenDaemonFormatSxprNet(conn, net, &buf, hvm, xendConfigVersion, 0) < 0)
goto error;
net = net->next;
}