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 <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Michal Privoznik 2017-06-15 15:46:32 +02:00
parent 2065499b60
commit 8ad01d5cc8

View 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: