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",