From: Michal Privoznik Date: Thu, 15 Jun 2017 13:46:32 +0000 (+0200) Subject: qemuMonitorTextAddDrive: Fail on unrecognized disk format X-Git-Tag: v3.5.0-rc1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ad01d5cc83d11c227315c34c3867e6a128227e7;p=thirdparty%2Flibvirt.git qemuMonitorTextAddDrive: Fail on unrecognized disk format 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 Reviewed-by: John Ferlan --- diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 66c94fbcd2..737e8389bc 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: