1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-11 09:17:52 +03:00

network: Move port deletion into the shutdown function

It will be more useful in there when calling from new places.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Martin Kletzander 2024-09-02 09:30:29 +02:00
parent 5988fdec91
commit 3e43670f01

View File

@ -2447,6 +2447,8 @@ networkShutdownNetwork(virNetworkDriverState *driver,
return -1;
}
virNetworkObjDeleteAllPorts(obj, cfg->stateDir);
/* now that we know it's stopped call the hook if present */
networkRunHook(obj, NULL, VIR_HOOK_NETWORK_OP_STOPPED,
VIR_HOOK_SUBOP_END);
@ -3458,8 +3460,6 @@ networkDestroy(virNetworkPtr net)
if ((ret = networkShutdownNetwork(driver, obj)) < 0)
goto cleanup;
virNetworkObjDeleteAllPorts(obj, cfg->stateDir);
/* @def replaced in virNetworkObjUnsetDefTransient */
def = virNetworkObjGetDef(obj);