From: Wen Congyang Date: Thu, 17 Feb 2011 03:32:16 +0000 (+0800) Subject: check more error info about whether drive_add failed X-Git-Tag: CVE-2011-1146~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34c13d0d1ade3c749ce8db0aba8240fc26d6e4e1;p=thirdparty%2Flibvirt.git check more error info about whether drive_add failed 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 --- diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 6d0ba4c2fd..0fd7546974 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -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: