[libvirt] [PATCH 08/21] qemu_hotplug: don't call DetachThisHostDevice for hostdev network devices

Peter Krempa pkrempa at redhat.com
Fri Mar 22 09:29:31 UTC 2019


On Thu, Mar 21, 2019 at 18:28:48 -0400, Laine Stump wrote:
> Back in the bad old days different device types required a different
> qemu monitor call to detach them, and so an <interface type='hostdev'>
> needed to call the function for detaching hostdevs, while other
> <interface> types could be deleted as netdevs.
> 
> Times have changed, and *all* device types are detached by calling the
> common function qemuDomainDeleteDevice(vm, alias), so we don't need to
> differentiate between hostdev interfaces and the others for that
> reason.
> 
> There are a few other netdev-specific functions called during
> qemuDomainDetachNetDevice() (clearing bandwidth limits, stopping the
> interface), but those turn into NOPs when type=hostdev, so they're
> safe to call for type=hostdev.
> 
> The only thing that is different + not a NOP is the call to
> virDomainAudit*() when qemuDomainDeleteDevice() fails, so if we add a
> conditional for that small bit of code, we can eliminate the callout
> from qemuDomainDetachNetDevice() to qemuDomainDetachThisDevice(),
> which makes this function fit the desired pattern for merging with the
> other detach functions, and paves the way to simplifying
> qemuDomainDetachHostDevice() too.
> 
> Signed-off-by: Laine Stump <laine at laine.org>
> ---
>  src/qemu/qemu_hotplug.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 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/b8e25ff6/attachment-0001.sig>


More information about the libvir-list mailing list