From: Peter Krempa Date: Wed, 13 Jun 2012 14:55:51 +0000 (+0200) Subject: virsh: Don't generate invalid XML in attach-disk command X-Git-Tag: v0.9.13-rc1~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b4740265cf1e9cd00165e54e1f5e81f9008bc63;p=thirdparty%2Flibvirt.git virsh: Don't generate invalid XML in attach-disk command The attach-disk command used with parameter --cache created an invalid XML snippet as the beginning of the element was not printed when used solely with --cache and no other attribute to driver. --- diff --git a/tools/virsh.c b/tools/virsh.c index 98305c0d7e..18625009ce 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -14765,18 +14765,18 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) virBufferAddLit(&buf, " rawio='yes'"); virBufferAddLit(&buf, ">\n"); - if (driver || subdriver) + if (driver || subdriver || cache) { virBufferAsprintf(&buf, " \n"); + } if (source) virBufferAsprintf(&buf, " \n",