提交 6574a01a 编写于 作者: B Bjoern Walk 提交者: John Ferlan

qemu: hotplug: fix changeable media ejection

Since return code is checked globally at the end of the function, let's
make sure that we set it correctly at any point.

This fixes a regression introduced in commit 0aa19f35 where the first
command to eject changeable media would fail unconditionally.
Signed-off-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
上级 f96cd890
......@@ -240,7 +240,8 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
/* If the tray is present and tray change event is supported wait for it to open. */
if (diskPriv->tray &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_TRAY_MOVED)) {
if (qemuHotplugWaitForTrayEject(driver, vm, disk, driveAlias, force) < 0)
rc = qemuHotplugWaitForTrayEject(driver, vm, disk, driveAlias, force);
if (rc < 0)
goto error;
} else {
/* otherwise report possible errors from the attempt to eject the media*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册