]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Fix virDomainObjParseFile object handling
authorJohn Ferlan <jferlan@redhat.com>
Mon, 26 Mar 2018 22:21:59 +0000 (18:21 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 6 Apr 2018 18:14:37 +0000 (14:14 -0400)
When virDomainObjParseFile runs, it returns a locked @obj with
one reference. Rather than just use virObjectUnref to clean that
up, use virObjectEndAPI.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/lxc/lxc_controller.c
tests/qemuxml2xmltest.c

index 59609b0a03f9b77c5183dcdc6439dacb2deca709..507bffda09ba0b7a79a8ea5a985c7f677123550c 100644 (file)
@@ -284,7 +284,7 @@ static void virLXCControllerFree(virLXCControllerPtr ctrl)
 
     VIR_FREE(ctrl->devptmx);
 
-    virObjectUnref(ctrl->vm);
+    virDomainObjEndAPI(&ctrl->vm);
     VIR_FREE(ctrl->name);
 
     if (ctrl->timerShutdown != -1)
index 3880c1d12232943504bbd920cea9ec51db50435d..d123180e791c7ee86fdc04c30bc44b840ae3eb8a 100644 (file)
@@ -96,7 +96,7 @@ testCompareStatusXMLToXMLFiles(const void *opaque)
     ret = 0;
 
  cleanup:
-    virObjectUnref(obj);
+    virDomainObjEndAPI(&obj);
     VIR_FREE(actual);
     return ret;
 }