From 5b4740265cf1e9cd00165e54e1f5e81f9008bc63 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 13 Jun 2012 16:55:51 +0200 Subject: [PATCH] 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. --- tools/virsh.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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", -- GitLab