]> 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 19:25:08 +0000 (15:25 -0400)
commitbdb5808173805d9510e6e870d36c7fdb8e358baf
tree0a48fe70191c8f77f98058373765bac456834878
parentdc0efacb6ff7cab6bc7a256d4361c2489956909f
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