mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
libxl: Add refcnt for args->vm during migration
When adding the @vm to the @args for usage during a thread or callback, let's add the reference to it at the time of adding to ensure nothing else deletes it. The corresponding Unref is then added to the Dispose function. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
2d2ed7b6f6
commit
8369ddfd1b
@ -239,6 +239,7 @@ libxlMigrationDstArgsDispose(void *obj)
|
||||
|
||||
libxlMigrationCookieFree(args->migcookie);
|
||||
VIR_FREE(args->socks);
|
||||
virObjectUnref(args->vm);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -608,7 +609,7 @@ libxlDomainMigrationDstPrepareTunnel3(virConnectPtr dconn,
|
||||
goto error;
|
||||
|
||||
args->conn = dconn;
|
||||
args->vm = vm;
|
||||
args->vm = virObjectRef(vm);
|
||||
args->flags = flags;
|
||||
args->migcookie = mig;
|
||||
/* Receive from pipeOut */
|
||||
@ -763,7 +764,7 @@ libxlDomainMigrationDstPrepare(virConnectPtr dconn,
|
||||
goto error;
|
||||
|
||||
args->conn = dconn;
|
||||
args->vm = vm;
|
||||
args->vm = virObjectRef(vm);
|
||||
args->flags = flags;
|
||||
args->socks = socks;
|
||||
args->nsocks = nsocks;
|
||||
|
Loading…
Reference in New Issue
Block a user