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:
parent
5988fdec91
commit
3e43670f01
@ -2447,6 +2447,8 @@ networkShutdownNetwork(virNetworkDriverState *driver,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virNetworkObjDeleteAllPorts(obj, cfg->stateDir);
|
||||||
|
|
||||||
/* now that we know it's stopped call the hook if present */
|
/* now that we know it's stopped call the hook if present */
|
||||||
networkRunHook(obj, NULL, VIR_HOOK_NETWORK_OP_STOPPED,
|
networkRunHook(obj, NULL, VIR_HOOK_NETWORK_OP_STOPPED,
|
||||||
VIR_HOOK_SUBOP_END);
|
VIR_HOOK_SUBOP_END);
|
||||||
@ -3458,8 +3460,6 @@ networkDestroy(virNetworkPtr net)
|
|||||||
if ((ret = networkShutdownNetwork(driver, obj)) < 0)
|
if ((ret = networkShutdownNetwork(driver, obj)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
virNetworkObjDeleteAllPorts(obj, cfg->stateDir);
|
|
||||||
|
|
||||||
/* @def replaced in virNetworkObjUnsetDefTransient */
|
/* @def replaced in virNetworkObjUnsetDefTransient */
|
||||||
def = virNetworkObjGetDef(obj);
|
def = virNetworkObjGetDef(obj);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user