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