]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_hotplug: try harder to eject media
authorPavel Hrdina <phrdina@redhat.com>
Mon, 29 Jun 2015 14:19:44 +0000 (16:19 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 9 Jul 2015 16:02:05 +0000 (18:02 +0200)
commit28554080ecbcd1e57266b29734feb76799c2ee48
tree68382e9ec440b5046e79409ca6fb14f283fb1fa2
parent256496e1499fcc7b20a51919eb4471987a36dbab
qemu_hotplug: try harder to eject media

Some guests lock the tray and QEMU eject command will simply fail to
eject the media.  But the guest OS can handle this attempt to eject the
media and can unlock the tray and open it. In this case, we should try
again to actually eject the media.

If the first attempt fails to detect a tray_open we will fail with
error, from monitor.  If we receive that event, we know, that the guest
properly reacted to the eject request, unlocked the tray and opened it.
In this case, we need to run the command again to actually eject the
media from the device.  The reason to call it again is, that QEMU
doesn't wait for the guest to react and report an error, that the tray
is locked.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1147471

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_hotplug.c
src/qemu/qemu_process.c