mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
qemuMigrationParamsFromJSON: Unify return value handling with other functions
This function doesn't have an overly verbose cleanup section as there isn't any error code path. Unify it with the rest of the functions which will simplify adding a possible error path. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a8d0ab02f6
commit
f2108c790c
@ -670,7 +670,7 @@ qemuMigrationParamsDump(qemuMigrationParamsPtr migParams,
|
||||
qemuMigrationParamsPtr
|
||||
qemuMigrationParamsFromJSON(virJSONValuePtr params)
|
||||
{
|
||||
qemuMigrationParamsPtr migParams;
|
||||
g_autoptr(qemuMigrationParams) migParams = NULL;
|
||||
qemuMigrationParamValuePtr pv;
|
||||
const char *name;
|
||||
const char *str;
|
||||
@ -680,7 +680,7 @@ qemuMigrationParamsFromJSON(virJSONValuePtr params)
|
||||
return NULL;
|
||||
|
||||
if (!params)
|
||||
return migParams;
|
||||
return g_steal_pointer(&migParams);
|
||||
|
||||
for (i = 0; i < QEMU_MIGRATION_PARAM_LAST; i++) {
|
||||
name = qemuMigrationParamTypeToString(i);
|
||||
@ -711,7 +711,7 @@ qemuMigrationParamsFromJSON(virJSONValuePtr params)
|
||||
}
|
||||
}
|
||||
|
||||
return migParams;
|
||||
return g_steal_pointer(&migParams);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user