提交 d49f18e9 编写于 作者: P Pavel Hrdina

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: NPavel Hrdina <phrdina@redhat.com>
上级 71bce84a
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册