[libvirt] [PATCH 06/21] qemu_hotplug: eliminate unnecessary call to qemuDomainDetachNetDevice()

Peter Krempa pkrempa at redhat.com
Fri Mar 22 08:29:35 UTC 2019


On Thu, Mar 21, 2019 at 18:28:46 -0400, Laine Stump wrote:
> qemuDomainDetachHostDevice() has a check at the end that calls
> qemuDomainDetachNetDevice() in the case that the hostdev is actually a
> Net device of type='hostdev'. A long time ago when device removal was
> (supposedly but not actually) synchronous, this would cause some extra
> code to be run prior to removing the device (e.g. restoring the original MAC
> address of the device, undoing some sort of virtual port profile, etc).
> 
> For quite awhile now the device removal has been asynchronous, so that
> "extra teardown" isn't handled by the detach function, but instead is
> handled by the Remove function called at a later time. The result is
> that when we call qemuDomainDetachNetDevice() from
> qemuDomainDetachHostDevice(), it ends up just calling
> qemuDomainDetachThisHostDevice() and returning, which is exactly what
> we do for all other hostdevs anyway.
> 
> Based on that, remove the behavioral difference when parent.type ==
> VIR_DOMAIN_DEVICE_NET, and just call qemuDomainDetachThisHostDevice()
> for all hostdevs.
> 
> Signed-off-by: Laine Stump <laine at laine.org>
> ---
>  src/qemu/qemu_hotplug.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)

ACK
-------------- 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/20190322/ba345169/attachment-0001.sig>


More information about the libvir-list mailing list