From b9ed82c9fba30666428f482b4830a26ffb0a4f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Fri, 13 Sep 2019 13:41:29 +0100 Subject: [PATCH] qemu: fix detach of hostdev based network interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes bug in commit bbe2aa627f621e6749af374b22856184d1f351dc Author: Daniel P. Berrangé Date: Thu Jul 26 17:24:30 2018 +0100 conf: simplify link from hostdev back to network device hostdevs have a link back to the original network device. This is fairly generic accepting any type of device, however, we don't intend to make use of this approach in future. It can thus be specialized to network devices. Reviewed-by: Cole Robinson Signed-off-by: Daniel P. Berrangé which mistakenly deleted the assignment to the 'net' variable, which meant we never invoked the network driver release callback Reviewed-by: Michal Privoznik Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_hotplug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index bd8868b0f7..16070f2a57 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4561,6 +4561,7 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver, } if (hostdev->parentnet) { + net = hostdev->parentnet; for (i = 0; i < vm->def->nnets; i++) { if (vm->def->nets[i] == hostdev->parentnet) { virDomainNetRemove(vm->def, i);