]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
check more error info about whether drive_add failed
authorWen Congyang <wency@cn.fujitsu.com>
Thu, 17 Feb 2011 03:32:16 +0000 (11:32 +0800)
committerEric Blake <eblake@redhat.com>
Thu, 17 Feb 2011 21:10:26 +0000 (14:10 -0700)
When we attach a disk, but we specify a wrong format of disk image,
qemu monitor command drive_add will fail, but libvirt does not detect
this error.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
src/qemu/qemu_monitor_text.c

index 6d0ba4c2fd29cb9ddd1f76ad082223ffb109ede6..0fd754697418e4c5208093ff121e173ba259e587 100644 (file)
@@ -2453,6 +2453,12 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon,
         goto cleanup;
     }
 
+    if (strstr(reply, "could not open disk image")) {
+        qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                        _("open disk image file failed"));
+        goto cleanup;
+    }
+
     ret = 0;
 
 cleanup: