From ece476ec2e0ff85ce342fb1b0b691f37e88553b7 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Mon, 15 Apr 2024 08:51:23 +0200 Subject: [PATCH] domain_interface: Fix build on FreeBSD In one of my recent commits I've chopped just too much and moved a variable declaration into a function not realizing it's still used on FreeBSD. Bring it back but only for the FreeBSD case. Fixes: f8b5bd855f8312457fd9ad8a68fb044982bd3cc6 Signed-off-by: Michal Privoznik --- src/hypervisor/domain_interface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hypervisor/domain_interface.c b/src/hypervisor/domain_interface.c index cc6aa8551a..756abb08e9 100644 --- a/src/hypervisor/domain_interface.c +++ b/src/hypervisor/domain_interface.c @@ -434,11 +434,14 @@ virDomainInterfaceDeleteDevice(virDomainDef *def, } break; case VIR_DOMAIN_NET_TYPE_BRIDGE: - case VIR_DOMAIN_NET_TYPE_NETWORK: + case VIR_DOMAIN_NET_TYPE_NETWORK: { #ifdef VIR_NETDEV_TAP_REQUIRE_MANUAL_CLEANUP + const virNetDevVPortProfile *vport = virDomainNetGetActualVirtPortProfile(net); + if (!(vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)) ignore_value(virNetDevTapDelete(net->ifname, net->backend.tap)); #endif + } break; case VIR_DOMAIN_NET_TYPE_USER: case VIR_DOMAIN_NET_TYPE_VHOSTUSER: -- 2.39.5