From 73908b1d1045ed7e0cb4298e6a7f3f5fdfd1a386 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. (cherry picked from commit 5b4740265cf1e9cd00165e54e1f5e81f9008bc63) --- tools/virsh.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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",