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

Peter Krempa pkrempa at redhat.com
Tue Mar 22 12:10:20 UTC 2016


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 at redhat.com>
> ---
>  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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160322/63a5c9e5/attachment-0001.sig>


More information about the libvir-list mailing list