41 lines
1.5 KiB
Diff
41 lines
1.5 KiB
Diff
From: Peter Krempa <pkrempa@redhat.com>
|
|
Date: Mon, 23 May 2016 16:32:06 +0200
|
|
Subject: [PATCH] qemu: hotplug: Fix error reported when cdrom tray is locked
|
|
|
|
Commit 1fad65d49aae364576bd91352a001249510f8d4e used a really big hammer
|
|
and overwrote the error message that might be reported by qemu if the
|
|
tray is locked. Fix it by reporting the error only if no error is
|
|
currently set.
|
|
|
|
Error after commit mentioned above:
|
|
error: internal error: timed out waiting for disk tray status update
|
|
|
|
New error:
|
|
error: internal error: unable to execute QEMU command 'eject': Tray of
|
|
device 'drive-ide0-0-0' is not open
|
|
|
|
(cherry picked from commit 2e75da42e41af0cd48ca6f75d0606b40a366cc54)
|
|
---
|
|
src/qemu/qemu_hotplug.c | 8 ++++++--
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
|
index d180b38..9f42e94 100644
|
|
--- a/src/qemu/qemu_hotplug.c
|
|
+++ b/src/qemu/qemu_hotplug.c
|
|
@@ -162,8 +162,12 @@ qemuHotplugWaitForTrayEject(virQEMUDriverPtr driver,
|
|
return -1;
|
|
|
|
if (rc > 0) {
|
|
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
- _("timed out waiting for disk tray status update"));
|
|
+ /* the caller called qemuMonitorEjectMedia which usually reports an
|
|
+ * error. Report the failure in an off-chance that it didn't. */
|
|
+ if (!virGetLastError()) {
|
|
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
+ _("timed out waiting for disk tray status update"));
|
|
+ }
|
|
return -1;
|
|
}
|
|
}
|