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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]