mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
qemu_migration.c: modernize qemuMigrationDstPrepare()
Use g_autofree 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
e200803f45
commit
1a86aee92a
@ -2306,8 +2306,7 @@ qemuMigrationDstPrepare(virDomainObjPtr vm,
|
||||
int fd)
|
||||
{
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
qemuProcessIncomingDefPtr inc = NULL;
|
||||
char *migrateFrom = NULL;
|
||||
g_autofree char *migrateFrom = NULL;
|
||||
|
||||
if (tunnel) {
|
||||
migrateFrom = g_strdup("stdio");
|
||||
@ -2329,7 +2328,7 @@ qemuMigrationDstPrepare(virDomainObjPtr vm,
|
||||
if (!hostIPv6Capable) {
|
||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
||||
_("host isn't capable of IPv6"));
|
||||
goto cleanup;
|
||||
return NULL;
|
||||
}
|
||||
/* IPv6 address must be escaped in brackets on the cmd line */
|
||||
encloseAddress = true;
|
||||
@ -2358,12 +2357,8 @@ qemuMigrationDstPrepare(virDomainObjPtr vm,
|
||||
migrateFrom = g_strdup_printf(incFormat, protocol, listenAddress, port);
|
||||
}
|
||||
|
||||
inc = qemuProcessIncomingDefNew(priv->qemuCaps, listenAddress,
|
||||
migrateFrom, fd, NULL);
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(migrateFrom);
|
||||
return inc;
|
||||
return qemuProcessIncomingDefNew(priv->qemuCaps, listenAddress,
|
||||
migrateFrom, fd, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user