mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-13 17:18:01 +03:00
Return error when updating cdrom device
The commit 84c59ffa
improved the way we change ejectable media.
If for any reason the first "eject" didn't open the tray we
should return with error.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
71bce84a06
commit
d49f18e976
@ -106,6 +106,9 @@ int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
|
||||
ret = qemuMonitorEjectMedia(priv->mon, driveAlias, force);
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
|
||||
if (ret < 0)
|
||||
goto audit;
|
||||
|
||||
virObjectRef(vm);
|
||||
/* we don't want to report errors from media tray_open polling */
|
||||
while (retries) {
|
||||
@ -121,14 +124,11 @@ int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
|
||||
virObjectUnref(vm);
|
||||
|
||||
if (retries <= 0) {
|
||||
if (ret == 0) {
|
||||
/* If ret == -1, EjectMedia already set an error message */
|
||||
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
_("Unable to eject media"));
|
||||
}
|
||||
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
_("Unable to eject media"));
|
||||
ret = -1;
|
||||
goto audit;
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
src = virDomainDiskGetSource(disk);
|
||||
if (src) {
|
||||
|
Loading…
Reference in New Issue
Block a user