The patch below fixes an issue in the python bindings with the
vir*Destroy methods. After the object is successfully destroyed,
the payload is cleared, using 'self._o = None'. This unfortunately
screws up virt object reference counts, as the payload should be 
free'd using the appropriate vir*Free function.

Thanks,
Cole
diff --git a/python/generator.py b/python/generator.py
index cb57bff..9421981 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -629,10 +629,10 @@ function_classes = {}
 function_classes["None"] = []
 
 function_post = {
-    'virDomainDestroy': "self._o = None",
-    'virNetworkDestroy': "self._o = None",
-    'virStoragePoolDestroy': "self._o = None",
-    'virStorageVolDestroy': "self._o = None",
+    'virDomainDestroy': "del(self)",
+    'virNetworkDestroy': "del(self)",
+    'virStoragePoolDestroy': "del(self)",
+    'virStorageVolDestroy': "del(self)",
 }
 
 # Functions returning an integral type which need special rules to
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to