]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_hotplug: eliminate unnecessary call to qemuDomainDetachNetDevice()
authorLaine Stump <laine@laine.org>
Mon, 18 Mar 2019 20:41:03 +0000 (16:41 -0400)
committerLaine Stump <laine@laine.org>
Mon, 25 Mar 2019 16:34:18 +0000 (12:34 -0400)
commit1ed46f3a22fe8570b4237477de5d5adb5a05f455
tree8c2261165db4cddad64c19770901ac2c77246726
parent287415e219fa2e477ae011ece275ab15a4be1d73
qemu_hotplug: eliminate unnecessary call to qemuDomainDetachNetDevice()

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@laine.org>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_hotplug.c