mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +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");
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user