diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index 496416e67a50b0949b6995fd56970de64d900f96..98da00969c60aa0a2725224264c9118e2ee263f4 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -935,14 +935,6 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname, int ret = 0; int vf = -1; - if (mode == VIR_NETDEV_MACVLAN_MODE_PASSTHRU) { - if (virtPortProfile && - virtPortProfile->virtPortType == VIR_NETDEV_VPORT_PROFILE_8021QBH) - ignore_value(virNetDevRestoreMacAddress(linkdev, stateDir)); - else - ignore_value(virNetDevRestoreNetConfig(linkdev, vf, stateDir)); - } - if (ifname) { if (virNetDevVPortProfileDisassociate(ifname, virtPortProfile, @@ -955,6 +947,14 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname, ret = -1; } + if (mode == VIR_NETDEV_MACVLAN_MODE_PASSTHRU) { + if (virtPortProfile && + virtPortProfile->virtPortType == VIR_NETDEV_VPORT_PROFILE_8021QBH) + ignore_value(virNetDevRestoreMacAddress(linkdev, stateDir)); + else + ignore_value(virNetDevRestoreNetConfig(linkdev, vf, stateDir)); + } + virNetlinkEventRemoveClient(0, macaddr, NETLINK_ROUTE); return ret;