diff --git a/ChangeLog b/ChangeLog index 37453b666c90d6417ac1ea9a32d3665cbf24ea5c..f8a2a555d325411be8d5cb0be737349f6fe98993 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue Aug 5 18:43:00 CEST 2008 Chris Lalancette + * src/xend_internal.c: Fix three bugs related to virsh attach-disk: + a) make sure to break in the xenDaemonAttachDevice() in the switch + b) convert a stray fprintf to a virXendError() + c) remove an additional "(device" on the front of the sexpr + expression passed to xend. This actually fixes virsh attach-disk + and virsh attach-interface work with Xen again + Tue Aug 5 18:36:00 CEST 2008 Chris Lalancette * src/stats_linux.c tests/statstest.c: Update the parsing of disks for xen block statistics. In particular, add support for > 16 xvd devices diff --git a/src/xend_internal.c b/src/xend_internal.c index 54e1d070431b6abe4c8531c7604071085b8908c4..b05e8706f48b6f27f5a09eac5c762b0081dd21a6 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -3900,6 +3900,7 @@ xenDaemonAttachDevice(virDomainPtr domain, const char *xml) STREQ(def->os.type, "hvm") ? 1 : 0, priv->xendConfigVersion) < 0) goto cleanup; + break; case VIR_DOMAIN_DEVICE_NET: if (xenDaemonFormatSxprNet(domain->conn, @@ -3908,6 +3909,7 @@ xenDaemonAttachDevice(virDomainPtr domain, const char *xml) STREQ(def->os.type, "hvm") ? 1 : 0, priv->xendConfigVersion) < 0) goto cleanup; + break; default: virXendError(domain->conn, VIR_ERR_NO_SUPPORT, "%s", @@ -4292,7 +4294,8 @@ virDomainPtr xenDaemonDomainDefineXML(virConnectPtr conn, const char *xmlDesc) { ret = xend_op(conn, "", "op", "new", "config", sexpr, NULL); VIR_FREE(sexpr); if (ret != 0) { - fprintf(stderr, _("Failed to create inactive domain %s\n"), name); + virXendError(conn, VIR_ERR_XEN_CALL, + _("Failed to create inactive domain %s\n"), name); goto error; } @@ -5029,7 +5032,6 @@ xenDaemonFormatSxprDisk(virConnectPtr conn ATTRIBUTE_UNUSED, xendConfigVersion == 1) return 0; - virBufferAddLit(buf, "(device "); /* Normally disks are in a (device (vbd ...)) block * but blktap disks ended up in a differently named * (device (tap ....)) block.... */ @@ -5083,7 +5085,7 @@ xenDaemonFormatSxprDisk(virConnectPtr conn ATTRIBUTE_UNUSED, else virBufferAddLit(buf, "(mode 'w')"); - virBufferAddLit(buf, "))"); + virBufferAddLit(buf, ")"); return 0; } @@ -5117,7 +5119,7 @@ xenDaemonFormatSxprNet(virConnectPtr conn, return -1; } - virBufferAddLit(buf, "(device (vif "); + virBufferAddLit(buf, "(vif "); virBufferVSprintf(buf, "(mac '%02x:%02x:%02x:%02x:%02x:%02x')", @@ -5177,7 +5179,7 @@ xenDaemonFormatSxprNet(virConnectPtr conn, if ((hvm) && (xendConfigVersion < 4)) virBufferAddLit(buf, "(type ioemu)"); - virBufferAddLit(buf, "))"); + virBufferAddLit(buf, ")"); return 0; }