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: f8b5bd855f
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2024-04-15 08:51:23 +02:00
parent 00db0619c6
commit ece476ec2e

View File

@ -434,11 +434,14 @@ virDomainInterfaceDeleteDevice(virDomainDef *def,
} }
break; break;
case VIR_DOMAIN_NET_TYPE_BRIDGE: 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 #ifdef VIR_NETDEV_TAP_REQUIRE_MANUAL_CLEANUP
const virNetDevVPortProfile *vport = virDomainNetGetActualVirtPortProfile(net);
if (!(vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)) if (!(vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH))
ignore_value(virNetDevTapDelete(net->ifname, net->backend.tap)); ignore_value(virNetDevTapDelete(net->ifname, net->backend.tap));
#endif #endif
}
break; break;
case VIR_DOMAIN_NET_TYPE_USER: case VIR_DOMAIN_NET_TYPE_USER:
case VIR_DOMAIN_NET_TYPE_VHOSTUSER: case VIR_DOMAIN_NET_TYPE_VHOSTUSER: