On Tue, Mar 22, 2016 at 12:40:13 +0100, Pavel Hrdina wrote:
QEMU changed the error message to:
"Tray of device 'drive-sata0-0-1' is not open"
and they may change the error massage in the future.
This updates the code to not depend on the text from the error message
but only on error itself.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 11 +++++------
src/qemu/qemu_monitor_json.c | 12 +-----------
src/qemu/qemu_monitor_text.c | 5 +----
3 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index b580283..a78bc60 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
...
@@ -220,7 +219,7 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr
driver,
if (virDomainObjWaitUntil(vm, now + CHANGE_MEDIA_TIMEOUT) != 0)
goto error;
}
- } while (ejectRetry && rc != 0);
You still need to check ejectRetry here
+ } while (rc < 0);
if (!virStorageSourceIsEmpty(newsrc)) {
if (qemuGetDriveSourceString(newsrc, conn, &sourcestr) < 0)
Ack with the fix