提交 f9b650a8 编写于 作者: J Ján Tomko

qemuBuildHostNetStr: remove unnecessary cleanup label

Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NCole Robinson <crobinso@redhat.com>
上级 1a8e03f8
...@@ -3916,13 +3916,12 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, ...@@ -3916,13 +3916,12 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER; VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virDomainNetType netType = virDomainNetGetActualType(net); virDomainNetType netType = virDomainNetGetActualType(net);
size_t i; size_t i;
char *ret = NULL;
if (net->script && netType != VIR_DOMAIN_NET_TYPE_ETHERNET) { if (net->script && netType != VIR_DOMAIN_NET_TYPE_ETHERNET) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("scripts are not supported on interfaces of type %s"), _("scripts are not supported on interfaces of type %s"),
virDomainNetTypeToString(netType)); virDomainNetTypeToString(netType));
goto cleanup; return NULL;
} }
switch (netType) { switch (netType) {
...@@ -3989,7 +3988,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, ...@@ -3989,7 +3988,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
const char *prefix = ""; const char *prefix = "";
if (!(addr = virSocketAddrFormat(&ip->address))) if (!(addr = virSocketAddrFormat(&ip->address)))
goto cleanup; return NULL;
if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET)) if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET))
prefix = "net="; prefix = "net=";
...@@ -4046,11 +4045,9 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, ...@@ -4046,11 +4045,9 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
virBufferTrim(&buf, ",", -1); virBufferTrim(&buf, ",", -1);
if (virBufferCheckError(&buf) < 0) if (virBufferCheckError(&buf) < 0)
goto cleanup; return NULL;
ret = virBufferContentAndReset(&buf); return virBufferContentAndReset(&buf);
cleanup:
return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册