mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: catch failure of drive_add
Previously when QEMU failed "drive_add" due to an error opening a file it would report "could not open disk image" These days though, QEMU reports "Could not open '/tmp/virtd-test_e3hnhh5/disk1.qcow2': Permission denied" which we were not detecting as an error condition. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
01d9c3497c
commit
b9cc6316c0
@ -1959,6 +1959,16 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (strstr(reply, "Could not open")) {
|
||||
size_t len = strlen(reply);
|
||||
if (reply[len - 1] == '\n')
|
||||
reply[len - 1] = '\0';
|
||||
|
||||
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
reply);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
|
Loading…
x
Reference in New Issue
Block a user