Re: [PATCH v2] qemu-hotplug: fix eject media

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

 



On Tue, Mar 22, 2016 at 12:40:13 +0100, Pavel Hrdina wrote:
> QEMU changed the error message to:
> 
>         "Tray of device 'drive-sata0-0-1' is not open"
> 
> and they may change the error massage in the future.
> 
> This updates the code to not depend on the text from the error message
> but only on error itself.
> 
> Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
> ---
>  src/qemu/qemu_hotplug.c      | 11 +++++------
>  src/qemu/qemu_monitor_json.c | 12 +-----------
>  src/qemu/qemu_monitor_text.c |  5 +----
>  3 files changed, 7 insertions(+), 21 deletions(-)
> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index b580283..a78bc60 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c

...

> @@ -220,7 +219,7 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
>              if (virDomainObjWaitUntil(vm, now + CHANGE_MEDIA_TIMEOUT) != 0)
>                  goto error;
>          }
> -    } while (ejectRetry && rc != 0);

You still need to check ejectRetry here

> +    } while (rc < 0);
>  
>      if (!virStorageSourceIsEmpty(newsrc)) {
>          if (qemuGetDriveSourceString(newsrc, conn, &sourcestr) < 0)

Ack with the fix

Attachment: signature.asc
Description: 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]