From: Michal Privoznik Date: Mon, 15 Apr 2024 06:51:23 +0000 (+0200) Subject: domain_interface: Fix build on FreeBSD X-Git-Tag: v10.3.0-rc1~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ece476ec2e0ff85ce342fb1b0b691f37e88553b7;p=thirdparty%2Flibvirt.git 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 --- 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: