mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-20 04:59:49 +00:00
qemu: Fix error propagation in qemuMigrationBegin
Commit v8.3.0-152-g49ef0f95c6 removed explicit VIR_FREE from qemuMigrationBegin, effectively reverting v1.2.14-57-g77ddd0bba2 The xml variable was used to hold the return value and thus had to be unset when an error happened after xml was already non-NULL. Such code may be quite confusing though and we usually avoid it by not storing anything to a return variable until everything succeeded. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
42cb548045
commit
c500955e95
@ -2487,6 +2487,7 @@ qemuMigrationSrcBegin(virConnectPtr conn,
|
|||||||
virQEMUDriver *driver = conn->privateData;
|
virQEMUDriver *driver = conn->privateData;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
||||||
g_autofree char *xml = NULL;
|
g_autofree char *xml = NULL;
|
||||||
|
char *ret = NULL;
|
||||||
virDomainAsyncJob asyncJob;
|
virDomainAsyncJob asyncJob;
|
||||||
|
|
||||||
if (cfg->migrateTLSForce &&
|
if (cfg->migrateTLSForce &&
|
||||||
@ -2538,9 +2539,11 @@ qemuMigrationSrcBegin(virConnectPtr conn,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = g_steal_pointer(&xml);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virDomainObjEndAPI(&vm);
|
virDomainObjEndAPI(&vm);
|
||||||
return g_steal_pointer(&xml);
|
return ret;
|
||||||
|
|
||||||
endjob:
|
endjob:
|
||||||
if (flags & VIR_MIGRATE_CHANGE_PROTECTION)
|
if (flags & VIR_MIGRATE_CHANGE_PROTECTION)
|
||||||
|
Loading…
Reference in New Issue
Block a user