mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
qemuMigrationParamsFromFlags: Use 'g_autoptr' to remove 'error:' label
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
da1831de96
commit
a8d0ab02f6
@ -534,7 +534,7 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr params,
|
|||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
qemuMigrationParty party)
|
qemuMigrationParty party)
|
||||||
{
|
{
|
||||||
qemuMigrationParamsPtr migParams;
|
g_autoptr(qemuMigrationParams) migParams = NULL;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (!(migParams = qemuMigrationParamsNew()))
|
if (!(migParams = qemuMigrationParamsNew()))
|
||||||
@ -565,14 +565,14 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr params,
|
|||||||
if (qemuMigrationParamsGetTPInt(migParams, item->param, params,
|
if (qemuMigrationParamsGetTPInt(migParams, item->param, params,
|
||||||
nparams, item->typedParam,
|
nparams, item->typedParam,
|
||||||
item->unit) < 0)
|
item->unit) < 0)
|
||||||
goto error;
|
return NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEMU_MIGRATION_PARAM_TYPE_ULL:
|
case QEMU_MIGRATION_PARAM_TYPE_ULL:
|
||||||
if (qemuMigrationParamsGetTPULL(migParams, item->param, params,
|
if (qemuMigrationParamsGetTPULL(migParams, item->param, params,
|
||||||
nparams, item->typedParam,
|
nparams, item->typedParam,
|
||||||
item->unit) < 0)
|
item->unit) < 0)
|
||||||
goto error;
|
return NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEMU_MIGRATION_PARAM_TYPE_BOOL:
|
case QEMU_MIGRATION_PARAM_TYPE_BOOL:
|
||||||
@ -581,7 +581,7 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr params,
|
|||||||
case QEMU_MIGRATION_PARAM_TYPE_STRING:
|
case QEMU_MIGRATION_PARAM_TYPE_STRING:
|
||||||
if (qemuMigrationParamsGetTPString(migParams, item->param, params,
|
if (qemuMigrationParamsGetTPString(migParams, item->param, params,
|
||||||
nparams, item->typedParam) < 0)
|
nparams, item->typedParam) < 0)
|
||||||
goto error;
|
return NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -591,24 +591,20 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr params,
|
|||||||
!(flags & VIR_MIGRATE_AUTO_CONVERGE)) {
|
!(flags & VIR_MIGRATE_AUTO_CONVERGE)) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("Turn auto convergence on to tune it"));
|
_("Turn auto convergence on to tune it"));
|
||||||
goto error;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS].set &&
|
if (migParams->params[QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS].set &&
|
||||||
!(flags & VIR_MIGRATE_PARALLEL)) {
|
!(flags & VIR_MIGRATE_PARALLEL)) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("Turn parallel migration on to tune it"));
|
_("Turn parallel migration on to tune it"));
|
||||||
goto error;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMigrationParamsSetCompression(params, nparams, flags, migParams) < 0)
|
if (qemuMigrationParamsSetCompression(params, nparams, flags, migParams) < 0)
|
||||||
goto error;
|
return NULL;
|
||||||
|
|
||||||
return migParams;
|
return g_steal_pointer(&migParams);
|
||||||
|
|
||||||
error:
|
|
||||||
qemuMigrationParamsFree(migParams);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user