提交 ee11ba29 编写于 作者: J John Ferlan

openvz: Clean up openvzDomainGetHostname

Remove the unnecessary goto error followed by goto cleanup
processing.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 369e5a82
......@@ -319,22 +319,18 @@ openvzDomainGetHostname(virDomainPtr dom, unsigned int flags)
hostname = openvzVEGetStringParam(dom, "hostname");
if (hostname == NULL)
goto error;
goto cleanup;
/* vzlist prints an unset hostname as '-' */
if (STREQ(hostname, "-")) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("Hostname of '%s' is unset"), vm->def->name);
goto error;
VIR_FREE(hostname);
}
cleanup:
virDomainObjEndAPI(&vm);
return hostname;
error:
VIR_FREE(hostname);
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册