mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
libvirt-domain.c: modernize virDomainMigrateCheckNotLocal()
Use g_autoptr() and remove the 'cleanup' label. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
606e7e0318
commit
fe14a62121
@ -3286,22 +3286,17 @@ virDomainMigrateVersion3Params(virDomainPtr domain,
|
|||||||
static int
|
static int
|
||||||
virDomainMigrateCheckNotLocal(const char *dconnuri)
|
virDomainMigrateCheckNotLocal(const char *dconnuri)
|
||||||
{
|
{
|
||||||
virURIPtr tempuri = NULL;
|
g_autoptr(virURI) tempuri = NULL;
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
if (!(tempuri = virURIParse(dconnuri)))
|
if (!(tempuri = virURIParse(dconnuri)))
|
||||||
goto cleanup;
|
return -1;
|
||||||
if (!tempuri->server || STRPREFIX(tempuri->server, "localhost")) {
|
if (!tempuri->server || STRPREFIX(tempuri->server, "localhost")) {
|
||||||
virReportInvalidArg(dconnuri, "%s",
|
virReportInvalidArg(dconnuri, "%s",
|
||||||
_("Attempt to migrate guest to the same host"));
|
_("Attempt to migrate guest to the same host"));
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
virURIFree(tempuri);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user