提交 87050bce 编写于 作者: M Michal Privoznik

virnetworkobj: Drop needless cleanup label in virNetworkObjDeletePort

The cleanup label in virNetworkObjDeletePort() function serves no
purpose. Drop it and thus simplify the function a bit.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 62464003
...@@ -1678,9 +1678,8 @@ virNetworkObjDeletePort(virNetworkObjPtr net, ...@@ -1678,9 +1678,8 @@ virNetworkObjDeletePort(virNetworkObjPtr net,
const unsigned char *uuid, const unsigned char *uuid,
const char *stateDir) const char *stateDir)
{ {
int ret = -1;
char uuidstr[VIR_UUID_STRING_BUFLEN]; char uuidstr[VIR_UUID_STRING_BUFLEN];
char *dir = NULL; VIR_AUTOFREE(char *) dir = NULL;
virNetworkPortDefPtr portdef; virNetworkPortDefPtr portdef;
virUUIDFormat(uuid, uuidstr); virUUIDFormat(uuid, uuidstr);
...@@ -1689,23 +1688,19 @@ virNetworkObjDeletePort(virNetworkObjPtr net, ...@@ -1689,23 +1688,19 @@ virNetworkObjDeletePort(virNetworkObjPtr net,
virReportError(VIR_ERR_NO_NETWORK_PORT, virReportError(VIR_ERR_NO_NETWORK_PORT,
_("Network port with UUID %s does not exist"), _("Network port with UUID %s does not exist"),
uuidstr); uuidstr);
goto cleanup; return -1;
} }
if (!(dir = virNetworkObjGetPortStatusDir(net, stateDir))) if (!(dir = virNetworkObjGetPortStatusDir(net, stateDir)))
goto cleanup; return -1;
if (virNetworkPortDefDeleteStatus(portdef, dir) < 0) if (virNetworkPortDefDeleteStatus(portdef, dir) < 0)
goto cleanup; return -1;
if (virHashRemoveEntry(net->ports, uuidstr) < 0) if (virHashRemoveEntry(net->ports, uuidstr) < 0)
goto cleanup; return -1;
ret = 0;
cleanup: return 0;
VIR_FREE(dir);
return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册