[libvirt] [PATCH 2/5] testCompareMemLock: Use correct free function for domain def

Michal Privoznik posted 5 patches 8 years, 1 month ago
[libvirt] [PATCH 2/5] testCompareMemLock: Use correct free function for domain def
Posted by Michal Privoznik 8 years, 1 month ago
This is a nice example of volkswagened code. It passes tests but
doesn't work as expected really. virDomainDef is not an instance
of virObject thus virObjectUnref() is not the correct function to
be called.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 tests/qemumemlocktest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c
index 66ebabb65..62bd25450 100644
--- a/tests/qemumemlocktest.c
+++ b/tests/qemumemlocktest.c
@@ -50,7 +50,7 @@ testCompareMemLock(const void *data)
     ret = virTestCompareToULL(info->memlock, qemuDomainGetMemLockLimitBytes(def));
 
  cleanup:
-    virObjectUnref(def);
+    virDomainDefFree(def);
     VIR_FREE(xml);
 
     return ret;
-- 
2.13.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/5] testCompareMemLock: Use correct free function for domain def
Posted by Ján Tomko 8 years, 1 month ago
On Thu, Aug 10, 2017 at 09:29:07AM +0200, Michal Privoznik wrote:
>This is a nice example of volkswagened code. It passes tests but

Please remove the brand reference before pushing

Jan

>doesn't work as expected really. virDomainDef is not an instance
>of virObject thus virObjectUnref() is not the correct function to
>be called.
>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list