[libvirt] [PATCH] qemu: hotplug: fail when net device detach times out

Peter Krempa pkrempa at redhat.com
Tue Mar 13 14:19:56 UTC 2018


On Tue, Mar 13, 2018 at 14:07:08 +0000, Jonathan Davies wrote:
> qemuDomainDetachNetDevice should not treat a timeout in a call to
> qemuDomainWaitForDeviceRemoval as success. Instead, it should treat it
> as failure -- this is the intention behind having a timeout.
> 
> If qemuDomainWaitForDeviceRemoval times out, it returns 0. In this
> instance, if qemuDomainDetachNetDevice returns 0, virsh detach-interface
> reports:
> 
>   Interface detached successfully
> 
> with a zero exit status.
> 
> But with a negative return value from qemuDomainDetachNetDevice, virsh
> detach-interface reports:
> 
>   error: Failed to detach interface
>   error: An error occurred, but the cause is unknown
> 
> with a non-zero exit status, which is more appropriate.
> 
> Signed-off-by: Jonathan Davies <jonathan.davies at nutanix.com>
> ---

This is unfortunately pre-existing behavior that we can't change. Some
versions of qemu don't support reporting of successful detach using the
event infrastructure, thus we can't ever know when that was successful.

Applications which need to be sure that the device was detached need to
register handlers for the libvirt device detached event.

NACK, this is broken behavior, but can't be changed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180313/da6305b0/attachment-0001.sig>


More information about the libvir-list mailing list