[libvirt] [PATCH] qemuMonitorTextAddDrive: Fail on unrecognized disk format

Michal Privoznik mprivozn at redhat.com
Wed Jun 21 09:44:07 UTC 2017


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 at redhat.com>
---
 src/qemu/qemu_monitor_text.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 66c94fbcd..737e8389b 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -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:
-- 
2.13.0




More information about the libvir-list mailing list