]> 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>
Tue, 28 May 2013 15:45:19 +0000 (11:45 -0400)
commit406d8a980973cfd4caebbc886f5b283233409a64
treeca9df581748ee9eae756e7c6d5a64317be1ff8b1
parent134e685b1de30000f19e58bd6cd485836ffc3fcb
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
src/qemu/qemu_hotplug.c