]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMonitorTextAddDrive: Fail on unrecognized disk format
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 15 Jun 2017 13:46:32 +0000 (15:46 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Sun, 25 Jun 2017 14:22:40 +0000 (16:22 +0200)
Since qemu commit 3ef6c40ad0b it can fail if trying to hotplug a
disk that is not qcow2 despite us saying it is. We need to error
out in that case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_monitor_text.c

index 66c94fbcd23a6735499229aa5cb72e4cbe40b72b..737e8389bce170e7d155a90f552bcaefa2515250 100644 (file)
@@ -1963,6 +1963,12 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon,
         goto cleanup;
     }
 
+    if (strstr(reply, "Image is not in")) {
+        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                       _("Incorrect disk format"));
+        goto cleanup;
+    }
+
     ret = 0;
 
  cleanup: