]> xenbits.xensource.com Git - libvirt.git/commitdiff
python: treat flags as default argument with value 0
authorGuannan Ren <gren@redhat.com>
Thu, 21 Mar 2013 08:27:09 +0000 (16:27 +0800)
committerGuannan Ren <gren@redhat.com>
Fri, 22 Mar 2013 03:50:09 +0000 (11:50 +0800)
The following four functions have not changed because default arguments
have to come after positional arguments. Changing them will break the
the binding APIs.

migrate(self, dconn, flags, dname, uri, bandwidth):
migrate2(self, dconn, dxml, flags, dname, uri, bandwidth):
migrateToURI(self, duri, flags, dname, bandwidth):
migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):

python/generator.py
python/libvirt-override-virConnect.py
python/libvirt-override-virDomain.py
python/libvirt-override-virDomainSnapshot.py
python/libvirt-override-virStoragePool.py
python/libvirt-override.py

index 986324a79ef5fc6687623e92d4e78be77b6406d1..fbaf7972b4f25db2d135e83c01bc9bcc5979b05a 100755 (executable)
@@ -1489,6 +1489,8 @@ def buildWrappers(module):
                     if n != index:
                         classes.write(", %s" % arg[0])
                     n = n + 1
+                if arg[0] == "flags":
+                    classes.write("=0");
                 classes.write("):\n")
                 writeDoc(module, name, args, '        ', classes)
                 n = 0
index 121ef6f631dface593b4d2d7418115113ad34c64..5495b70f267f49fbe92ba162d5c12ca54e4dc435 100644 (file)
         self.domainEventCallbackID[ret] = opaque
         return ret
 
-    def listAllDomains(self, flags):
+    def listAllDomains(self, flags=0):
         """List all domains and returns a list of domain objects"""
         ret = libvirtmod.virConnectListAllDomains(self._o, flags)
         if ret is None:
 
         return retlist
 
-    def listAllStoragePools(self, flags):
+    def listAllStoragePools(self, flags=0):
         """Returns a list of storage pool objects"""
         ret = libvirtmod.virConnectListAllStoragePools(self._o, flags)
         if ret is None:
 
         return retlist
 
-    def listAllNetworks(self, flags):
+    def listAllNetworks(self, flags=0):
         """Returns a list of network objects"""
         ret = libvirtmod.virConnectListAllNetworks(self._o, flags)
         if ret is None:
 
         return retlist
 
-    def listAllInterfaces(self, flags):
+    def listAllInterfaces(self, flags=0):
         """Returns a list of interface objects"""
         ret = libvirtmod.virConnectListAllInterfaces(self._o, flags)
         if ret is None:
 
         return retlist
 
-    def listAllDevices(self, flags):
+    def listAllDevices(self, flags=0):
         """Returns a list of host node device objects"""
         ret = libvirtmod.virConnectListAllNodeDevices(self._o, flags)
         if ret is None:
 
         return retlist
 
-    def listAllNWFilters(self, flags):
+    def listAllNWFilters(self, flags=0):
         """Returns a list of network filter objects"""
         ret = libvirtmod.virConnectListAllNWFilters(self._o, flags)
         if ret is None:
 
         return retlist
 
-    def listAllSecrets(self, flags):
+    def listAllSecrets(self, flags=0):
         """Returns a list of secret objects"""
         ret = libvirtmod.virConnectListAllSecrets(self._o, flags)
         if ret is None:
index ccc4d5f07ef0a6353252d2d3565aff34b6bf1b06..142b1d461783eefe7ba856c5659eb3a64a1fa3ef 100644 (file)
@@ -1,4 +1,4 @@
-    def listAllSnapshots(self, flags):
+    def listAllSnapshots(self, flags=0):
         """List all snapshots and returns a list of snapshot objects"""
         ret = libvirtmod.virDomainListAllSnapshots(self._o, flags)
         if ret is None:
index bf708a52bd6b85b16846fbf004ee57edee2e871d..ec53358e2549b3054d1badfd6b6b0494222f9b48 100644 (file)
@@ -6,7 +6,7 @@
         """Get the domain that a snapshot was created for"""
         return self.domain()
 
-    def listAllChildren(self, flags):
+    def listAllChildren(self, flags=0):
         """List all child snapshots and returns a list of snapshot objects"""
         ret = libvirtmod.virDomainSnapshotListAllChildren(self._o, flags)
         if ret is None:
index ffe160cdcdd82ee34f882f5b4a0062369e7c74c5..325e403799cdabe2b8db16e90040abcb16f4065f 100644 (file)
@@ -1,4 +1,4 @@
-    def listAllVolumes(self, flags):
+    def listAllVolumes(self, flags=0):
         """List all storage volumes and returns a list of storage volume objects"""
         ret = libvirtmod.virStoragePoolListAllVolumes(self._o, flags)
         if ret is None:
index 82d7dcbc02db989c32a1384c9f5bc353f7eba5c2..ccfec4825ae25f2cf2230c3dd586a66efeaeb711 100644 (file)
@@ -85,7 +85,7 @@ def registerErrorHandler(f, ctx):
        Returns 1 in case of success."""
     return libvirtmod.virRegisterErrorHandler(f,ctx)
 
-def openAuth(uri, auth, flags):
+def openAuth(uri, auth, flags=0):
     ret = libvirtmod.virConnectOpenAuth(uri, auth, flags)
     if ret is None:raise libvirtError('virConnectOpenAuth() failed')
     return virConnect(_obj=ret)