[libvirt] [PATCH] Fix storage pool autostart python binding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The attached patch fixes a few issues with the storage api
python bindings. The pool GetAutostart is now generated as
intended. Also the libvirtError class now accepts the pool
or vol object passed to it when a command fails.

Thanks,
Cole

diff --git a/python/libvir.py b/python/libvir.py
index 3a38898..784152a 100644
--- a/python/libvir.py
+++ b/python/libvir.py
@@ -15,13 +15,17 @@ import types
 
 # The root of all libvirt errors.
 class libvirtError(Exception):
-    def __init__(self, msg, conn=None, dom=None, net=None):
+    def __init__(self, msg, conn=None, dom=None, net=None, pool=None, vol=None):
         Exception.__init__(self, msg)
 
         if dom is not None:
             conn = dom._conn
         elif net is not None:
             conn = net._conn
+        elif pool is not None:
+            conn = pool._conn
+        elif vol is not None:
+            conn = vol._conn
 
         if conn is None:
             self.err = virGetLastError()
diff --git a/python/libvirt-python-api.xml b/python/libvirt-python-api.xml
index da643d7..f3b82fc 100644
--- a/python/libvirt-python-api.xml
+++ b/python/libvirt-python-api.xml
@@ -83,6 +83,11 @@
       <return type='int' info='the autostart flag, or None in case of error'/>
       <arg name='domain' type='virDomainPtr' info='a network object'/>
     </function>
+    <function name='virStoragePoolGetAutostart' file='python'>
+      <info>Extract the autostart flag for a storage pool</info>
+      <return type='int' info='the autostart flag, or None in case of error'/>
+      <arg name='pool' type='virStoragePoolPtr' info='a storage pool object'/>
+    </function>
     <function name='virDomainBlockStats' file='python'>
       <info>Extracts block device statistics for a domain</info>
       <return type='virDomainBlockStats' info='a tuple of statistics'/>
--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]