mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-13 19:25:13 +00:00
openvz: Clean up openvzDomainGetHostname
Remove the unnecessary goto error followed by goto cleanup processing. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
369e5a828f
commit
ee11ba29f5
@ -319,22 +319,18 @@ openvzDomainGetHostname(virDomainPtr dom, unsigned int flags)
|
|||||||
|
|
||||||
hostname = openvzVEGetStringParam(dom, "hostname");
|
hostname = openvzVEGetStringParam(dom, "hostname");
|
||||||
if (hostname == NULL)
|
if (hostname == NULL)
|
||||||
goto error;
|
goto cleanup;
|
||||||
|
|
||||||
/* vzlist prints an unset hostname as '-' */
|
/* vzlist prints an unset hostname as '-' */
|
||||||
if (STREQ(hostname, "-")) {
|
if (STREQ(hostname, "-")) {
|
||||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("Hostname of '%s' is unset"), vm->def->name);
|
_("Hostname of '%s' is unset"), vm->def->name);
|
||||||
goto error;
|
VIR_FREE(hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virDomainObjEndAPI(&vm);
|
virDomainObjEndAPI(&vm);
|
||||||
return hostname;
|
return hostname;
|
||||||
|
|
||||||
error:
|
|
||||||
VIR_FREE(hostname);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user