[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] qemu: hotplug: Report error if we hit tray status timeout



If we exceed the timeout waiting for the tray status to change,
we don't report an error. Fix it
---
I hit this trying to eject floppy media for a win10 VM with F24
qemu, but I didn't dig deeper to figure out _why_ it's timing out...

 src/qemu/qemu_hotplug.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 03e5309..e5f8a38 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -224,7 +224,13 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
             goto error;
 
         while (disk->tray_status != VIR_DOMAIN_DISK_TRAY_OPEN) {
-            if (virDomainObjWaitUntil(vm, now + CHANGE_MEDIA_TIMEOUT) != 0)
+            int rc2 = virDomainObjWaitUntil(vm, now + CHANGE_MEDIA_TIMEOUT);
+            if (rc2 == 1) {
+                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                               _("timed out waiting for "
+                                 "disk tray status update"));
+            }
+            if (rc2 != 0)
                 goto error;
         }
     } while (rc < 0);
-- 
2.7.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]