[libvirt] [PATCH] qemu: Don't report error on successful media eject

Eric Blake eblake at redhat.com
Tue May 28 15:31:46 UTC 2013


On 05/28/2013 08:37 AM, Cole Robinson wrote:
> 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 at redhat.com
> ---
>  src/qemu/qemu_hotplug.c | 26 ++++++++++++++------------
>  1 file changed, 14 insertions(+), 12 deletions(-)

ACK.

> +
> +    if (disk->src) {
> +        /* deliberately don't depend on 'ret' as 'eject' may have failed the
> +         * first time and we are gonna check the drive state anyway */

Comment motion, but might be worth s/gonna/going to/ while touching it
(I'm actually surprised that thunderbird didn't flag the slang 'gonna'
as a misspelled word).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130528/6614a432/attachment-0001.sig>


More information about the libvir-list mailing list