]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Don't report error on successful media eject
authorCole Robinson <crobinso@redhat.com>
Tue, 28 May 2013 14:23:00 +0000 (10:23 -0400)
committerCole Robinson <crobinso@redhat.com>
Wed, 12 Jun 2013 20:30:31 +0000 (16:30 -0400)
commitf8085a5471ce9ffc6e3987357c64bb601cd360da
tree080da7909fbd10b92c90c61465b6b48f1a3d6de3
parenta93f2757e29914177b0eb70068d817e72c54281c
qemu: Don't report error on successful media eject

If we are just ejecting media, ret == -1 even after the retry loop
determines that the tray is open, as requested. This means media
disconnect always report's error.

Fix it, and fix some other mini issues:

- Don't overwrite the 'eject' error message if the retry loop fails
- Move the retries decrement inside the loop, otherwise the final loop
  might succeed, yet retries == 0 and we will raise error
- Setting ret = -1 in the disk->src check is unneeded
- Fix comment typos

cc: mprivozn@redhat.com
(cherry picked from commit 406d8a980973cfd4caebbc886f5b283233409a64)
src/qemu/qemu_hotplug.c