[libvirt] [PATCH 4/4] libxl: MigratePerform: properly cleanup after libxlDomObjFromDomain

Jim Fehlig posted 4 patches 7 years, 2 months ago
[libvirt] [PATCH 4/4] libxl: MigratePerform: properly cleanup after libxlDomObjFromDomain
Posted by Jim Fehlig 7 years, 2 months ago
ibxlDomObjFromDomain to returns locked and ref counted virDomainObj but
libxlDomainMigratePerform3Params only unlocks the object on exit. Convert
it to use the virDomainObjEndAPI function for cleanup.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---
 src/libxl/libxl_driver.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 67a638da0..6f1c69b1d 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -6086,8 +6086,7 @@ libxlDomainMigratePerform3Params(virDomainPtr dom,
     ret = 0;
 
  cleanup:
-    if (vm)
-        virObjectUnlock(vm);
+    virDomainObjEndAPI(&vm);
     return ret;
 }
 
-- 
2.16.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 4/4] libxl: MigratePerform: properly cleanup after libxlDomObjFromDomain
Posted by John Ferlan 7 years, 2 months ago

On 03/13/2018 01:26 PM, Jim Fehlig wrote:
> ibxlDomObjFromDomain to returns locked and ref counted virDomainObj but

libxlDom...

> libxlDomainMigratePerform3Params only unlocks the object on exit. Convert
> it to use the virDomainObjEndAPI function for cleanup.
> 
> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> ---
>  src/libxl/libxl_driver.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list