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.11.4~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=73908b1d1045ed7e0cb4298e6a7f3f5fdfd1a386;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. (cherry picked from commit 5b4740265cf1e9cd00165e54e1f5e81f9008bc63) --- diff --git a/tools/virsh.c b/tools/virsh.c index 7307ccb5ca..fd1acbbcb2 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -14493,18 +14493,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",