Hello community,
here is the log from the commit of package python-libvirt-python for
openSUSE:Factory checked in at 2020-08-13 10:13:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-libvirt-python (Old)
and /work/SRC/openSUSE:Factory/.python-libvirt-python.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-libvirt-python"
Thu Aug 13 10:13:45 2020 rev:36 rq:824563 version:6.6.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-libvirt-python/python-libvirt-python.changes
2020-07-13 09:04:37.175956911 +0200
+++
/work/SRC/openSUSE:Factory/.python-libvirt-python.new.3399/python-libvirt-python.changes
2020-08-13 10:14:48.746665752 +0200
@@ -1,0 +2,6 @@
+Wed Aug 5 23:50:08 UTC 2020 - James Fehlig <[email protected]>
+
+- Update to 6.6.0
+ - Add all new APIs and constants in libvirt 6.6.0
+
+-------------------------------------------------------------------
Old:
----
libvirt-python-6.5.0.tar.gz
libvirt-python-6.5.0.tar.gz.asc
New:
----
libvirt-python-6.6.0.tar.gz
libvirt-python-6.6.0.tar.gz.asc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-libvirt-python.spec ++++++
--- /var/tmp/diff_new_pack.DsdmMN/_old 2020-08-13 10:14:51.266667328 +0200
+++ /var/tmp/diff_new_pack.DsdmMN/_new 2020-08-13 10:14:51.270667331 +0200
@@ -23,7 +23,7 @@
%define srcname libvirt-python
Name: python-libvirt-python
URL: https://libvirt.org/
-Version: 6.5.0
+Version: 6.6.0
Release: 0
Summary: Library providing a virtualization API
License: LGPL-2.1-or-later
++++++ libvirt-python-6.5.0.tar.gz -> libvirt-python-6.6.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/ChangeLog
new/libvirt-python-6.6.0/ChangeLog
--- old/libvirt-python-6.5.0/ChangeLog 2020-07-03 08:53:09.000000000 +0200
+++ new/libvirt-python-6.6.0/ChangeLog 2020-08-03 00:22:35.000000000 +0200
@@ -1,3 +1,241 @@
+2020-07-27 Philipp Hahn <[email protected]>
+
+ generator: Fix parent type
+ The constructors for virDomain, virStoragePool, virDomainCheckpoint,
+ virDomainSnapshot expect virConnect as their first argument. The current
+ code always uses `self`, which is okay when such an instance is created
+ from a method of virConnect itself, but there are several cases where
+ this is not the case:
+
+ virDomain.migrate() -> virDomain
+ virDomain.migrate2() -> virDomain
+ virDomain.migrate3() -> virDomain
+ virDomainCheckpoint.getParent() -> virDomainCheckpoint
+ virDomainSnapshot.getParent() -> virDomainSnapshot
+ virStorageVol.storagePoolLookupByVolume() -> virStoragePool
+
+ > libvirt.py:1850: error: Argument 1 to "virDomain" has incompatible type
"virDomain"; expected "virConnect"
+ > libvirt.py:1871: error: Argument 1 to "virDomain" has incompatible type
"virDomain"; expected "virConnect"
+ > libvirt.py:1888: error: Argument 1 to "virDomain" has incompatible type
"virDomain"; expected "virConnect"
+ > libvirt.py:3422: error: Argument 1 to "virStorageVol" has incompatible
type "virStoragePool"; expected "virConnect"
+ > libvirt.py:6835: error: Argument 1 to "virDomainCheckpoint" has
incompatible type "virDomainCheckpoint"; expected "virDomain"
+ > libvirt.py:6943: error: Argument 1 to "virDomainSnapshot" has
incompatible type "virDomainSnapshot"; expected "virDomain"
+
+ >>> import libvirt
+ >>> con = libvirt.open('test:///default')
+ >>> dom = con.lookupByName("test")
+ >>> first =
dom.checkpointCreateXML("""<domaincheckpoint><name>First</name></domaincheckpoint>""")
+ >>> first.domain()
+ <libvirt.virDomain object at 0x7f728c3b6b80>
+ ^^^^^^
+ >>> second =
dom.checkpointCreateXML("""<domaincheckpoint><name>Second</name></domaincheckpoint>""")
+ >>> parent = second.getParent()
+ >>> parent.domain()
+ <libvirt.virDomainCheckpoint object at 0x7f728c424d30>
+ ^^^^^^^^^^^^^^^^
+
+
+
+2020-07-27 Philipp Hahn <[email protected]>
+
+ debug: Fix bit-rot in debug output
+ Let the compiler optimize out the printf() call instead of doing it with
the
+ pre-processor as the later does not catch format string errors or the
following
+ case, where NULLSTR() is used but not defined:
+
+ > libvirt-qemu-override.c: In function
‘libvirt_qemu_virConnectDomainQemuMonitorEventRegister’:
+ > libvirt-qemu-override.c:271:34: warning: implicit declaration of
function ‘NULLSTR’; did you mean ‘NULL’? [-Wimplicit-function-declaration]
+ > 271 | pyobj_conn, pyobj_dom, NULLSTR(event), pyobj_cbData,
flags);
+ > | ^~~~~~~
+ > libvirt-qemu-override.c:39:28: note: in definition of macro ‘DEBUG’
+ > 39 | while (0) {printf(fmt, __VA_ARGS__);}
+ > | ^~~~~~~~~~~
+ > libvirt-qemu-override.c:270:11: warning: format ‘%s’ expects argument of
type ‘char *’, but argument 4 has type ‘int’ [-Wformat=]
+ > 270 |
DEBUG("libvirt_qemu_virConnectDomainQemuMonitorEventRegister(%p %p %s %p %x)
called\n",
+ > |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ > 271 | pyobj_conn, pyobj_dom, NULLSTR(event), pyobj_cbData,
flags);
+ > | ~~~~~~~~~~~~~~
+ > | |
+ > | int
+ > libvirt-qemu-override.c:39:23: note: in definition of macro ‘DEBUG’
+ > 39 | while (0) {printf(fmt, __VA_ARGS__);}
+ > | ^~~
+ > libvirt-qemu-override.c:270:73: note: format string is defined here
+ > 270 |
DEBUG("libvirt_qemu_virConnectDomainQemuMonitorEventRegister(%p %p %s %p %x)
called\n",
+ > |
~^
+ > |
|
+ > |
char *
+ > |
%d
+
+ Copy the definition of NULLSTR from libvirt/src/internal.h to
typewrappers.h
+
+
+
+2020-07-27 Philipp Hahn <[email protected]>
+
+ libvirtaio: Fix return types of callback
+ libvirt defines the signature for the callback functions, e.g. the
+ functions for remove() must return -1 on error and 0 on success. Raising
+ an exception violates that contract.
+
+ _remove_timeout() did not explicitly handle a double-remove and
+ implicitly passed on the exception.
+
+ update() expects no return value, so remove the pointless return to pass
+ on None.
+
+
+
+2020-07-27 Philipp Hahn <[email protected]>
+
+ qemu-api: Fix return type
+ The API XML description uses "C types": "str *" is not valid.
+
+
+
+2020-07-27 Philipp Hahn <[email protected]>
+
+ generator: Fix domainCheckpoint.listAllChildren()
+ virDomainCheckpoint(dom, _obj)
+ expects a reference to the virDomain as its first argument, but
+ virDomainCheckpoint.listAllChildren()
+ passes `self` instead:
+
+ libvirt.py:7056: error: Argument 1 to "virDomainCheckpoint" has
incompatible type "virDomainCheckpoint"; expected "virDomain"
+
+ >>> import libvirt
+ >>> con = libvirt.open('test:///default')
+ >>> dom = con.lookupByName("test")
+ >>> first =
dom.checkpointCreateXML("""<domaincheckpoint><name>First</name></domaincheckpoint>""")
+ >>> second =
dom.checkpointCreateXML("""<domaincheckpoint><name>Second</name></domaincheckpoint>""")
+ >>> child, = first.listAllChildren()
+ >>> second.domain()
+ <libvirt.virDomain object at 0x7f828d777b80>
+ ^^^^^^^^^
+ >>> child.domain()
+ <libvirt.virDomainCheckpoint object at 0x7f828d8160a0>
+ ^^^^^^^^^^^^^^^^^^^
+
+
+
+2020-07-27 Philipp Hahn <[email protected]>
+
+ generator: Fix domainSnapshot.listAllChildren()
+ virDomainSnapshot(dom, _obj)
+ expects a reference to the virDomain as its first argument, but
+ virDomainSnapshot.listAllChildren()
+ passes `self` instead:
+
+ libvirt.py:6459: error: Argument 1 to "virDomainSnapshot" has incompatible
type "virDomainSnapshot"; expected "virDomain"
+
+ >>> import libvirt
+ >>> con = libvirt.open('test:///default')
+ >>> dom = con.lookupByName("test")
+ >>> first =
dom.snapshotCreateXML("""<domainsnapshot><name>First</name></domainsnapshot>""")
+ >>> second =
dom.snapshotCreateXML("""<domainsnapshot><name>Second</name></domainsnapshot>""")
+ >>> child, = first.listAllChildren()
+ >>> second.domain()
+ <libvirt.virDomain object at 0x7fb32be3cfd0>
+ ^^^^^^^^^
+ >>> child.domain()
+ <libvirt.virDomainSnapshot object at 0x7fb32bdb9080>
+ ^^^^^^^^^^^^^^^^^
+
+
+
+2020-07-27 Philipp Hahn <[email protected]>
+
+ generator: Fix string formatting
+ remove excessive arguments.
+
+
+
+2020-07-27 Philipp Hahn <[email protected]>
+
+ generator: Fix undefined variables file
+ generator.py:931:15: F821 undefined name 'file'
+ generator.py:951:15: F821 undefined name 'file'
+
+
+
+2020-07-22 Jiri Denemark <[email protected]>
+
+ Post-release version bump to 6.6.0
+
+
+2020-07-17 Radostin Stoyanov <[email protected]>
+
+ generator: Fix typos
+
+
+2020-07-15 Radostin Stoyanov <[email protected]>
+
+ examples: Refactor domipaddrs
+ This patch makes domipaddrs example compatible with Python3.
+
+
+
+2020-07-06 Cole Robinson <[email protected]>
+
+ Fix PY_SSIZE_T_CLEAN deprecation warning
+ Seen running on fedora 32:
+
+ DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
+ ret = libvirtmod.virDomainLookupByUUID(self._o, uuid)
+
+ This comes from here: https://bugs.python.org/issue36381
+ See the section about PY_SSIZE_T_CLEAN here:
+ https://docs.python.org/3/c-api/arg.html#strings-and-buffers
+
+ Solution is to use Py_ssize_t instead of int for unpacked '#' values,
+ combined with defined PY_SSIZE_T_CLEAN before importing Python.h. The
+ latter turns these deprecation warnings into runtime segfaults though
+ if we missed an instance.
+
+ I verified the virt-manager's test suite works fine after this change
+
+
+
+2020-07-05 Cole Robinson <[email protected]>
+
+ generator: Fix SyntaxWarning
+ $ ./setup.py build
+ running build
+ /usr/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt
+ /usr/bin/python3 generator.py libvirt
/usr/share/libvirt/api/libvirt-api.xml
+ generator.py:1562: SyntaxWarning: "is" with a literal. Did you mean "=="?
+ if classname is "virStorageVol":
+ ...
+
+
+
+2020-07-03 Michal Privoznik <[email protected]>
+
+ virStream: Use larger buffer for sendAll/recvAll methods
+ There are four methods which receive/send entire stream
+ (sendAll(), recvAll(), sparseSendAll() and sparseRecvAll()). All
+ these have an intermediary buffer which is either filled by
+ incoming stream and passed to a user provided callback to handle
+ the data, or the other way round - user fills it with data they
+ want to send and the buffer is handed over to virStream.
+
+ But the buffer is incredibly small which leads to smaller packets
+ being sent and thus increased overhead. What we can do is to use
+ the same buffer as their C counterparts do (e.g.
+ virStreamSendAll()) - they all use VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX
+ long buffer (which is the maximum size of a stream packet we
+ send) - this is almost exactly 256KiB (it's 256KiB - 24B for the
+ header).
+
+ Reviewed-by: Pavel Hrdina <[email protected]>
+
+
+2020-07-03 Michal Privoznik <[email protected]>
+
+ MANIFEST: Distribute sparsestream.py example
+ Reviewed-by: Pavel Hrdina <[email protected]>
+
+
2020-06-08 Daniel P. Berrangé <[email protected]>
setup: post-release version bump to 6.5.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/MANIFEST
new/libvirt-python-6.6.0/MANIFEST
--- old/libvirt-python-6.5.0/MANIFEST 1970-01-01 01:00:00.000000000 +0100
+++ new/libvirt-python-6.6.0/MANIFEST 2020-08-03 00:22:35.000000000 +0200
@@ -0,0 +1,46 @@
+# file GENERATED by distutils, do NOT edit
+AUTHORS
+COPYING
+COPYING.LESSER
+ChangeLog
+MANIFEST
+README
+generator.py
+libvirt-lxc-override-api.xml
+libvirt-lxc-override.c
+libvirt-override-api.xml
+libvirt-override-virConnect.py
+libvirt-override-virDomain.py
+libvirt-override-virDomainCheckpoint.py
+libvirt-override-virDomainSnapshot.py
+libvirt-override-virNetwork.py
+libvirt-override-virStoragePool.py
+libvirt-override-virStream.py
+libvirt-override.c
+libvirt-override.py
+libvirt-python.spec
+libvirt-qemu-override-api.xml
+libvirt-qemu-override.c
+libvirt-utils.c
+libvirt-utils.h
+libvirtaio.py
+sanitytest.py
+setup.py
+tox.ini
+typewrappers.c
+typewrappers.h
+examples/consolecallback.py
+examples/dominfo.py
+examples/domipaddrs.py
+examples/domrestore.py
+examples/domsave.py
+examples/domstart.py
+examples/esxlist.py
+examples/event-test.py
+examples/nodestats.py
+examples/sparsestream.py
+examples/topology.py
+examples/guest-vcpus/guest-vcpu-daemon.py
+examples/guest-vcpus/guest-vcpu.py
+tests/test_conn.py
+tests/test_domain.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/PKG-INFO
new/libvirt-python-6.6.0/PKG-INFO
--- old/libvirt-python-6.5.0/PKG-INFO 2020-07-03 08:53:09.000000000 +0200
+++ new/libvirt-python-6.6.0/PKG-INFO 2020-08-03 00:22:35.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: libvirt-python
-Version: 6.5.0
+Version: 6.6.0
Summary: The libvirt virtualization API python binding
Home-page: http://www.libvirt.org
Author: Libvirt Maintainers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/examples/domipaddrs.py
new/libvirt-python-6.6.0/examples/domipaddrs.py
--- old/libvirt-python-6.5.0/examples/domipaddrs.py 2020-05-05
08:48:51.000000000 +0200
+++ new/libvirt-python-6.6.0/examples/domipaddrs.py 2020-08-03
00:17:46.000000000 +0200
@@ -4,55 +4,59 @@
import libvirt
import sys
-def usage():
- print "Usage: %s [URI] DOMAIN" % sys.argv[0]
- print " Print domain interfaces along with their MAC and IP
addresses"
-
-uri = None
-name = None
-args = len(sys.argv)
-
-if args == 2:
- name = sys.argv[1]
-elif args == 3:
- uri = sys.argv[1]
- name = sys.argv[2]
-else:
- usage()
- sys.exit(2)
-
-try:
- conn = libvirt.open(uri)
-except libvirt.libvirtError:
- print "Unable to open connection to libvirt"
- sys.exit(1)
-
-try:
- dom = conn.lookupByName(name)
-except libvirt.libvirtError:
- print "Domain %s not found" % name
- sys.exit(0)
-
-ifaces =
dom.interfaceAddresses(libvirt.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE);
-if (ifaces == None):
- print "Failed to get domain interfaces"
- sys.exit(0)
-
-print " {0:10} {1:20} {2:12} {3}".format("Interface", "MAC address",
"Protocol", "Address")
-
-def toIPAddrType(addrType):
- if addrType == libvirt.VIR_IP_ADDR_TYPE_IPV4:
- return "ipv4"
- elif addrType == libvirt.VIR_IP_ADDR_TYPE_IPV6:
- return "ipv6"
-
-for (name, val) in ifaces.iteritems():
- if val['addrs']:
- for addr in val['addrs']:
- print " {0:10} {1:19}".format(name, val['hwaddr']),
- print " {0:12} {1}/{2} ".format(toIPAddrType(addr['type']),
addr['addr'], addr['prefix']),
- print
+IPTYPE = {
+ libvirt.VIR_IP_ADDR_TYPE_IPV4: "ipv4",
+ libvirt.VIR_IP_ADDR_TYPE_IPV6: "ipv6",
+}
+
+
+def print_dom_ifaces(dom):
+ ifaces =
dom.interfaceAddresses(libvirt.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE)
+ if (ifaces == None):
+ print("Failed to get domain interfaces")
+ sys.exit(0)
+
+ print(" {0:10} {1:20} {2:12} {3}".format(
+ "Interface", "MAC address", "Protocol", "Address"))
+
+ for (name, val) in ifaces.items():
+ if val['addrs']:
+ for addr in val['addrs']:
+ print (" {0:10} {1:19} {2:12} {3}/{4}".format(
+ name,
+ val['hwaddr'],
+ IPTYPE[addr['type']],
+ addr['addr'],
+ addr['prefix']))
+ else:
+ print(" {0:10} {1:19} {2:12} {3}".format(name, val['hwaddr'],
"N/A", "N/A"))
+
+
+if __name__ == "__main__":
+ uri = None
+ name = None
+ args = len(sys.argv)
+
+ if args == 2:
+ name = sys.argv[1]
+ elif args == 3:
+ uri = sys.argv[1]
+ name = sys.argv[2]
else:
- print " {0:10} {1:19}".format(name, val['hwaddr']),
- print " {0:12} {1}".format("N/A", "N/A"),
- print
+ print("Usage: %s [URI] DOMAIN" % sys.argv[0])
+ print(" Print domain interfaces along with their MAC and IP
addresses")
+ sys.exit(2)
+
+ try:
+ conn = libvirt.open(uri)
+ except libvirt.libvirtError:
+ raise SystemExit("Unable to open connection to libvirt")
+
+ try:
+ dom = conn.lookupByName(name)
+ except libvirt.libvirtError:
+ print("Domain %s not found" % name)
+ sys.exit(0)
+
+ print_dom_ifaces(dom)
+ conn.close()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/examples/sparsestream.py
new/libvirt-python-6.6.0/examples/sparsestream.py
--- old/libvirt-python-6.5.0/examples/sparsestream.py 1970-01-01
01:00:00.000000000 +0100
+++ new/libvirt-python-6.6.0/examples/sparsestream.py 2020-08-03
00:17:46.000000000 +0200
@@ -0,0 +1,117 @@
+#!/usr/bin/env python3
+# Example of sparse streams usage
+#
+# Authors:
+# Michal Privoznik <[email protected]>
+
+import libvirt, sys, os
+
+def bytesWriteHandler(stream, buf, opaque):
+ fd = opaque
+ return os.write(fd, buf)
+
+def bytesReadHandler(stream, nbytes, opaque):
+ fd = opaque
+ return os.read(fd, nbytes)
+
+def recvSkipHandler(stream, length, opaque):
+ fd = opaque
+ cur = os.lseek(fd, length, os.SEEK_CUR)
+ return os.ftruncate(fd, cur)
+
+def sendSkipHandler(stream, length, opaque):
+ fd = opaque
+ return os.lseek(fd, length, os.SEEK_CUR)
+
+def holeHandler(stream, opaque):
+ fd = opaque
+ cur = os.lseek(fd, 0, os.SEEK_CUR)
+
+ try:
+ data = os.lseek(fd, cur, os.SEEK_DATA)
+ except OSError as e:
+ if e.errno != 6:
+ raise e
+ else:
+ data = -1;
+ # There are three options:
+ # 1) data == cur; @cur is in data
+ # 2) data > cur; @cur is in a hole, next data at @data
+ # 3) data < 0; either @cur is in trailing hole, or @cur is beyond EOF.
+ if data < 0:
+ # case 3
+ inData = False
+ eof = os.lseek(fd, 0, os.SEEK_END)
+ if (eof < cur):
+ raise RuntimeError("Current position in file after EOF: %d" % cur)
+ sectionLen = eof - cur
+ else:
+ if (data > cur):
+ # case 2
+ inData = False
+ sectionLen = data - cur
+ else:
+ # case 1
+ inData = True
+
+ # We don't know where does the next hole start. Let's find out.
+ # Here we get the same options as above
+ hole = os.lseek(fd, data, os.SEEK_HOLE)
+ if hole < 0:
+ # case 3. But wait a second. There is always a trailing hole.
+ # Do the best what we can here
+ raise RuntimeError("No trailing hole")
+
+ if (hole == data):
+ # case 1. Again, this is suspicious. The reason we are here is
+ # because we are in data. But at the same time we are in a
+ # hole. WAT?
+ raise RuntimeError("Impossible happened")
+ else:
+ # case 2
+ sectionLen = hole - data
+ os.lseek(fd, cur, os.SEEK_SET)
+ return [inData, sectionLen]
+
+def download(vol, st, filename):
+ offset = 0
+ length = 0
+
+ fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, mode=0o0660)
+ vol.download(st, offset, length,
libvirt.VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM)
+ st.sparseRecvAll(bytesWriteHandler, recvSkipHandler, fd)
+
+ os.close(fd)
+
+def upload(vol, st, filename):
+ offset = 0
+ length = 0
+
+ fd = os.open(filename, os.O_RDONLY)
+ vol.upload(st, offset, length,
libvirt.VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM)
+ st.sparseSendAll(bytesReadHandler, holeHandler, sendSkipHandler, fd)
+
+ os.close(fd)
+
+# main
+if len(sys.argv) != 5:
+ print("Usage: ", sys.argv[0], " URI --upload/--download VOLUME FILE")
+ print("Either uploads local FILE to libvirt VOLUME, or downloads libvirt ")
+ print("VOLUME into local FILE while preserving FILE/VOLUME sparseness")
+ sys.exit(1)
+
+conn = libvirt.open(sys.argv[1])
+vol = conn.storageVolLookupByKey(sys.argv[3])
+
+st = conn.newStream()
+
+if sys.argv[2] == "--download":
+ download(vol, st, sys.argv[4])
+elif sys.argv[2] == "--upload":
+ upload(vol, st, sys.argv[4])
+else:
+ print("Unknown operation: %s " % sys.argv[1])
+ sys.exit(1)
+
+st.finish()
+conn.close()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/generator.py
new/libvirt-python-6.6.0/generator.py
--- old/libvirt-python-6.5.0/generator.py 2020-01-15 16:20:01.000000000
+0100
+++ new/libvirt-python-6.6.0/generator.py 2020-08-03 00:17:46.000000000
+0200
@@ -10,7 +10,7 @@
lxc_enums = {} # { enumType: { enumConstant: enumValue } }
qemu_enums = {} # { enumType: { enumConstant: enumValue } }
event_ids = []
-params = [] # [ (parameName, paramValue)... ]
+params = [] # [ (paramName, paramValue)... ]
import os
import sys
@@ -145,7 +145,7 @@
if debug:
print("end %s" % tag)
if tag == 'function':
- # fuctions come from source files, hence 'virerror.c'
+ # functions come from source files, hence 'virerror.c'
if self.function is not None:
if self.function_module in libvirt_headers + \
["event", "virevent", "virerror", "virterror"]:
@@ -274,7 +274,7 @@
#######################################################################
#
-# Some filtering rukes to drop functions/types which should not
+# Some filtering rules to drop functions/types which should not
# be exposed as-is on the Python interface
#
#######################################################################
@@ -389,7 +389,7 @@
#######################################################################
#
# This part writes the C <-> Python stubs libvirt.[ch] and
-# the table libvirt-export.c to add when registrering the Python module
+# the table libvirt-export.c to add when registering the Python module
#
#######################################################################
@@ -530,11 +530,11 @@
)
-# These are functions which the generator skips completly - no python
+# These are functions which the generator skips completely - no python
# or C code is generated. Generally should not be used for any more
# functions than those already listed
skip_function = (
- 'virConnectListDomains', # Python API is called virConectListDomainsID for
unknown reasons
+ 'virConnectListDomains', # Python API is called virConnectListDomainsID
for unknown reasons
'virConnSetErrorFunc', # Not used in Python API XXX is this a bug ?
'virResetError', # Not used in Python API XXX is this a bug ?
'virGetVersion', # Python C code is manually written
@@ -572,7 +572,7 @@
'virConnectListAllNWFilterBindings', # overridden in virConnect.py
'virConnectListAllSecrets', # overridden in virConnect.py
'virConnectGetAllDomainStats', # overridden in virConnect.py
- 'virDomainListGetStats', # overriden in virConnect.py
+ 'virDomainListGetStats', # overridden in virConnect.py
'virStreamRecvAll', # Pure python libvirt-override-virStream.py
'virStreamSendAll', # Pure python libvirt-override-virStream.py
@@ -766,7 +766,7 @@
if file == "python_accessor":
if args[1][1] == "char *":
c_call = "\n VIR_FREE(%s->%s);\n" % (
- args[0][0], args[1][0], args[0][0],
args[1][0])
+ args[0][0], args[1][0])
c_call = c_call + " %s->%s = (%s)strdup((const xmlChar
*)%s);\n" % (args[0][0],
args[1][0], args[1][1], args[1][0])
else:
@@ -928,7 +928,7 @@
parser.close()
except IOError:
msg = sys.exc_info()[1]
- print(file, ":", msg)
+ print(api_xml, ":", msg)
sys.exit(1)
n = len(list(funcs.keys()))
@@ -948,7 +948,7 @@
parser.close()
except IOError:
msg = sys.exc_info()[1]
- print(file, ":", msg)
+ print(override_api_xml, ":", msg)
if not quiet:
# XXX: This is not right, same function already in @functions
@@ -1029,36 +1029,37 @@
#
# The type automatically remapped to generated classes
+# "C-type" -> (accessor, create, class, parent-class)
#
classes_type = {
- "virDomainPtr": ("._o", "virDomain(self,_obj=%s)", "virDomain"),
- "virDomain *": ("._o", "virDomain(self, _obj=%s)", "virDomain"),
- "virNetworkPtr": ("._o", "virNetwork(self, _obj=%s)", "virNetwork"),
- "virNetwork *": ("._o", "virNetwork(self, _obj=%s)", "virNetwork"),
- "virNetworkPortPtr": ("._o", "virNetworkPort(self, _obj=%s)",
"virNetworkPort"),
- "virNetworkPort *": ("._o", "virNetworkPort(self, _obj=%s)",
"virNetworkPort"),
- "virInterfacePtr": ("._o", "virInterface(self, _obj=%s)", "virInterface"),
- "virInterface *": ("._o", "virInterface(self, _obj=%s)", "virInterface"),
- "virStoragePoolPtr": ("._o", "virStoragePool(self, _obj=%s)",
"virStoragePool"),
- "virStoragePool *": ("._o", "virStoragePool(self, _obj=%s)",
"virStoragePool"),
- "virStorageVolPtr": ("._o", "virStorageVol(self, _obj=%s)",
"virStorageVol"),
- "virStorageVol *": ("._o", "virStorageVol(self, _obj=%s)",
"virStorageVol"),
- "virNodeDevicePtr": ("._o", "virNodeDevice(self, _obj=%s)",
"virNodeDevice"),
- "virNodeDevice *": ("._o", "virNodeDevice(self, _obj=%s)",
"virNodeDevice"),
- "virSecretPtr": ("._o", "virSecret(self, _obj=%s)", "virSecret"),
- "virSecret *": ("._o", "virSecret(self, _obj=%s)", "virSecret"),
- "virNWFilterPtr": ("._o", "virNWFilter(self, _obj=%s)", "virNWFilter"),
- "virNWFilter *": ("._o", "virNWFilter(self, _obj=%s)", "virNWFilter"),
- "virNWFilterBindingPtr": ("._o", "virNWFilterBinding(self, _obj=%s)",
"virNWFilterBinding"),
- "virNWFilterBinding *": ("._o", "virNWFilterBinding(self, _obj=%s)",
"virNWFilterBinding"),
- "virStreamPtr": ("._o", "virStream(self, _obj=%s)", "virStream"),
- "virStream *": ("._o", "virStream(self, _obj=%s)", "virStream"),
- "virConnectPtr": ("._o", "virConnect(_obj=%s)", "virConnect"),
- "virConnect *": ("._o", "virConnect(_obj=%s)", "virConnect"),
- "virDomainCheckpointPtr": ("._o", "virDomainCheckpoint(self,_obj=%s)",
"virDomainCheckpoint"),
- "virDomainCheckpoint *": ("._o", "virDomainCheckpoint(self, _obj=%s)",
"virDomainCheckpoint"),
- "virDomainSnapshotPtr": ("._o", "virDomainSnapshot(self,_obj=%s)",
"virDomainSnapshot"),
- "virDomainSnapshot *": ("._o", "virDomainSnapshot(self, _obj=%s)",
"virDomainSnapshot"),
+ "virDomainPtr": ("._o", "virDomain(%(p)s, _obj=%(o)s)", "virDomain",
"virConnect"),
+ "virDomain *": ("._o", "virDomain(%(p)s, _obj=%(o)s)", "virDomain",
"virConnect"),
+ "virNetworkPtr": ("._o", "virNetwork(%(p)s, _obj=%(o)s)", "virNetwork",
"virConnect"),
+ "virNetwork *": ("._o", "virNetwork(%(p)s, _obj=%(o)s)", "virNetwork",
"virConnect"),
+ "virNetworkPortPtr": ("._o", "virNetworkPort(%(p)s, _obj=%(o)s)",
"virNetworkPort", "virNetwork"),
+ "virNetworkPort *": ("._o", "virNetworkPort(%(p)s, _obj=%(o)s)",
"virNetworkPort", "virNetwork"),
+ "virInterfacePtr": ("._o", "virInterface(%(p)s, _obj=%(o)s)",
"virInterface", "virConnect"),
+ "virInterface *": ("._o", "virInterface(%(p)s, _obj=%(o)s)",
"virInterface", "virConnect"),
+ "virStoragePoolPtr": ("._o", "virStoragePool(%(p)s, _obj=%(o)s)",
"virStoragePool", "virConnect"),
+ "virStoragePool *": ("._o", "virStoragePool(%(p)s, _obj=%(o)s)",
"virStoragePool", "virConnect"),
+ "virStorageVolPtr": ("._o", "virStorageVol(%(p)s, _obj=%(o)s)",
"virStorageVol", "virConnect"),
+ "virStorageVol *": ("._o", "virStorageVol(%(p)s, _obj=%(o)s)",
"virStorageVol", "virConnect"),
+ "virNodeDevicePtr": ("._o", "virNodeDevice(%(p)s, _obj=%(o)s)",
"virNodeDevice", "virConnect"),
+ "virNodeDevice *": ("._o", "virNodeDevice(%(p)s, _obj=%(o)s)",
"virNodeDevice", "virConnect"),
+ "virSecretPtr": ("._o", "virSecret(%(p)s, _obj=%(o)s)", "virSecret",
"virConnect"),
+ "virSecret *": ("._o", "virSecret(%(p)s, _obj=%(o)s)", "virSecret",
"virConnect"),
+ "virNWFilterPtr": ("._o", "virNWFilter(%(p)s, _obj=%(o)s)", "virNWFilter",
"virConnect"),
+ "virNWFilter *": ("._o", "virNWFilter(%(p)s, _obj=%(o)s)", "virNWFilter",
"virConnect"),
+ "virNWFilterBindingPtr": ("._o", "virNWFilterBinding(%(p)s, _obj=%(o)s)",
"virNWFilterBinding", "virConnect"),
+ "virNWFilterBinding *": ("._o", "virNWFilterBinding(%(p)s, _obj=%(o)s)",
"virNWFilterBinding", "virConnect"),
+ "virStreamPtr": ("._o", "virStream(%(p)s, _obj=%(o)s)", "virStream",
"virConnect"),
+ "virStream *": ("._o", "virStream(%(p)s, _obj=%(o)s)", "virStream",
"virConnect"),
+ "virConnectPtr": ("._o", "virConnect(_obj=%(o)s)", "virConnect", ""),
+ "virConnect *": ("._o", "virConnect(_obj=%(o)s)", "virConnect", ""),
+ "virDomainCheckpointPtr": ("._o", "virDomainCheckpoint(%(p)s,
_obj=%(o)s)", "virDomainCheckpoint", "virDomain"),
+ "virDomainCheckpoint *": ("._o", "virDomainCheckpoint(%(p)s, _obj=%(o)s)",
"virDomainCheckpoint", "virDomain"),
+ "virDomainSnapshotPtr": ("._o", "virDomainSnapshot(%(p)s, _obj=%(o)s)",
"virDomainSnapshot", "virDomain"),
+ "virDomainSnapshot *": ("._o", "virDomainSnapshot(%(p)s, _obj=%(o)s)",
"virDomainSnapshot", "virDomain"),
}
primary_classes = ["virDomain", "virNetwork", "virNetworkPort",
@@ -1524,8 +1525,10 @@
" if ret is None:raise libvirtError('%s() failed')\n" %
(name))
+ r_type, r_info, r_field = ret
+ tinfo = classes_type[r_type]
classes.write(" return ")
- classes.write(classes_type[ret[0]][1] % ("ret"))
+ classes.write(tinfo[1] % {"o": "ret"})
classes.write("\n")
# For functions returning an integral type there are
@@ -1555,10 +1558,23 @@
classes.write("\n")
for classname in classes_list:
+ PARENTS = {
+ "virConnect": "self._conn",
+ "virDomain": "self._dom",
+ "virNetwork": "self._net",
+ classname: "self",
+ }
+
if classname == "None":
pass
else:
classes.write("class %s(object):\n" % (classname))
+ if classname == "virStorageVol":
+ classes.write(" # The size (in bytes) of buffer used in
sendAll(),\n")
+ classes.write(" # recvAll(), sparseSendAll() and
sparseRecvAll()\n")
+ classes.write(" # methods. This corresponds to the size of
payload\n")
+ classes.write(" # of a stream packet.\n")
+ classes.write(" streamBufSize = 262120\n\n")
if classname in [ "virDomain", "virNetwork", "virInterface",
"virStoragePool",
"virStorageVol", "virNodeDevice",
"virSecret","virStream",
"virNWFilter", "virNWFilterBinding" ]:
@@ -1574,9 +1590,7 @@
"virNWFilter", "virNWFilterBinding" ]:
classes.write(" self._conn = conn\n")
elif classname in [ "virStorageVol", "virStoragePool" ]:
- classes.write(" self._conn = conn\n" + \
- " if not isinstance(conn, virConnect):\n"
+ \
- " self._conn = conn._conn\n")
+ classes.write(" self._conn = conn if isinstance(conn,
virConnect) else conn._conn # type: virConnect\n")
elif classname in [ "virDomainCheckpoint", "virDomainSnapshot" ]:
classes.write(" self._dom = dom\n")
classes.write(" self._conn = dom.connect()\n")
@@ -1724,8 +1738,10 @@
#
# generate the returned class wrapper for the object
#
+ r_type, r_info, r_field = ret
+ tinfo = classes_type[r_type]
classes.write(" __tmp = ")
- classes.write(classes_type[ret[0]][1] % ("ret"))
+ classes.write(tinfo[1] % {"o": "ret", "p":
PARENTS[tinfo[3]]})
classes.write("\n")
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/libvirt-lxc-override.c
new/libvirt-python-6.6.0/libvirt-lxc-override.c
--- old/libvirt-python-6.5.0/libvirt-lxc-override.c 2020-01-15
16:20:01.000000000 +0100
+++ new/libvirt-python-6.6.0/libvirt-lxc-override.c 2020-08-03
00:17:46.000000000 +0200
@@ -36,7 +36,7 @@
printf(fmt, __VA_ARGS__)
#else
# define DEBUG(fmt, ...) \
- do {} while (0)
+ while (0) {printf(fmt, __VA_ARGS__);}
#endif
/************************************************************************
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libvirt-python-6.5.0/libvirt-override-virDomainCheckpoint.py
new/libvirt-python-6.6.0/libvirt-override-virDomainCheckpoint.py
--- old/libvirt-python-6.5.0/libvirt-override-virDomainCheckpoint.py
2019-08-05 19:18:56.000000000 +0200
+++ new/libvirt-python-6.6.0/libvirt-override-virDomainCheckpoint.py
2020-08-03 00:17:46.000000000 +0200
@@ -14,6 +14,6 @@
retlist = list()
for chkptr in ret:
- retlist.append(virDomainCheckpoint(self, _obj=chkptr))
+ retlist.append(virDomainCheckpoint(self.domain(), _obj=chkptr))
return retlist
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libvirt-python-6.5.0/libvirt-override-virDomainSnapshot.py
new/libvirt-python-6.6.0/libvirt-override-virDomainSnapshot.py
--- old/libvirt-python-6.5.0/libvirt-override-virDomainSnapshot.py
2018-09-03 19:31:03.000000000 +0200
+++ new/libvirt-python-6.6.0/libvirt-override-virDomainSnapshot.py
2020-08-03 00:17:46.000000000 +0200
@@ -14,6 +14,6 @@
retlist = list()
for snapptr in ret:
- retlist.append(virDomainSnapshot(self, _obj=snapptr))
+ retlist.append(virDomainSnapshot(self.domain(), _obj=snapptr))
return retlist
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libvirt-python-6.5.0/libvirt-override-virStoragePool.py
new/libvirt-python-6.6.0/libvirt-override-virStoragePool.py
--- old/libvirt-python-6.5.0/libvirt-override-virStoragePool.py 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.6.0/libvirt-override-virStoragePool.py 2020-08-03
00:17:46.000000000 +0200
@@ -6,6 +6,6 @@
retlist = list()
for volptr in ret:
- retlist.append(virStorageVol(self, _obj=volptr))
+ retlist.append(virStorageVol(self._conn, _obj=volptr))
return retlist
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/libvirt-override-virStream.py
new/libvirt-python-6.6.0/libvirt-override-virStream.py
--- old/libvirt-python-6.5.0/libvirt-override-virStream.py 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.6.0/libvirt-override-virStream.py 2020-08-03
00:17:46.000000000 +0200
@@ -39,7 +39,7 @@
return os.write(fd, buf)
"""
while True:
- got = self.recv(1024*64)
+ got = self.recv(virStorageVol.streamBufSize)
if got == -2:
raise libvirtError("cannot use recvAll with "
"nonblocking stream")
@@ -74,7 +74,7 @@
"""
while True:
try:
- got = handler(self, 1024*64, opaque)
+ got = handler(self, virStorageVol.streamBufSize, opaque)
except:
e = sys.exc_info()[1]
try:
@@ -189,7 +189,7 @@
# actually allocate the hole
"""
while True:
- want = 64 * 1024
+ want = virStorageVol.streamBufSize
got = self.recvFlags(want, VIR_STREAM_RECV_STOP_AT_HOLE)
if got == -2:
raise libvirtError("cannot use sparseRecvAll with "
@@ -251,7 +251,7 @@
self.abort()
continue
- want = 64 * 1024
+ want = virStorageVol.streamBufSize
if (want > sectionLen):
want = sectionLen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/libvirt-override.c
new/libvirt-python-6.6.0/libvirt-override.c
--- old/libvirt-python-6.5.0/libvirt-override.c 2020-01-15 16:20:01.000000000
+0100
+++ new/libvirt-python-6.6.0/libvirt-override.c 2020-08-03 00:17:46.000000000
+0200
@@ -17,6 +17,7 @@
/* We want to see *_LAST enums. */
#define VIR_ENUM_SENTINELS
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <libvirt/libvirt.h>
#include <libvirt/virterror.h>
@@ -40,7 +41,7 @@
printf(fmt, __VA_ARGS__)
#else
# define DEBUG(fmt, ...) \
- do {} while (0)
+ while (0) {printf(fmt, __VA_ARGS__);}
#endif
@@ -3040,7 +3041,7 @@
virConnectPtr conn;
PyObject *pyobj_conn;
unsigned char * uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virDomainLookupByUUID",
&pyobj_conn, &uuid, &len))
@@ -3283,7 +3284,7 @@
virConnectPtr conn;
PyObject *pyobj_conn;
unsigned char * uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virNetworkLookupByUUID",
&pyobj_conn, &uuid, &len))
@@ -3992,7 +3993,7 @@
virConnectPtr conn;
PyObject *pyobj_conn;
unsigned char * uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virStoragePoolLookupByUUID",
&pyobj_conn, &uuid, &len))
@@ -4233,7 +4234,7 @@
virConnectPtr conn;
PyObject *pyobj_conn;
unsigned char * uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virSecretLookupByUUID",
&pyobj_conn, &uuid, &len))
@@ -4393,7 +4394,7 @@
virSecretPtr secret;
PyObject *pyobj_secret;
const char *value;
- int size;
+ Py_ssize_t size;
unsigned int flags;
if (!PyArg_ParseTuple(args, (char *)"Oz#I:virSecretSetValue",
&pyobj_secret,
@@ -4402,8 +4403,8 @@
secret = (virSecretPtr) PyvirSecret_Get(pyobj_secret);
LIBVIRT_BEGIN_ALLOW_THREADS;
- c_retval = virSecretSetValue(secret, (const unsigned char *)value, size,
- flags);
+ c_retval = virSecretSetValue(secret, (const unsigned char *)value,
+ (size_t) size, flags);
LIBVIRT_END_ALLOW_THREADS;
return libvirt_intWrap(c_retval);
@@ -4471,7 +4472,7 @@
virConnectPtr conn;
PyObject *pyobj_conn;
unsigned char * uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virNWFilterLookupByUUID",
&pyobj_conn, &uuid, &len))
@@ -10247,7 +10248,7 @@
virNetworkPtr net;
PyObject *pyobj_net;
unsigned char *uuid;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, (char *)"Oz#:virNetworkPortLookupByUUID",
&pyobj_net, &uuid, &len))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/libvirt-python.spec
new/libvirt-python-6.6.0/libvirt-python.spec
--- old/libvirt-python-6.5.0/libvirt-python.spec 2020-07-03
08:53:08.000000000 +0200
+++ new/libvirt-python-6.6.0/libvirt-python.spec 2020-08-03
00:22:35.000000000 +0200
@@ -14,7 +14,7 @@
Summary: The libvirt virtualization API python3 binding
Name: libvirt-python
-Version: 6.5.0
+Version: 6.6.0
Release: 1%{?dist}
Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
Url: http://libvirt.org
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/libvirt-qemu-override-api.xml
new/libvirt-python-6.6.0/libvirt-qemu-override-api.xml
--- old/libvirt-python-6.5.0/libvirt-qemu-override-api.xml 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.6.0/libvirt-qemu-override-api.xml 2020-08-03
00:17:46.000000000 +0200
@@ -3,14 +3,14 @@
<symbols>
<function name='virDomainQemuMonitorCommand' file='python-qemu'>
<info>Send an arbitrary monitor command through qemu monitor of
domain</info>
- <return type='str *' info='the command output or None in case of
error'/>
+ <return type='char *' info='the command output or None in case of
error'/>
<arg name='domain' type='virDomainPtr' info='pointer to domain
object'/>
<arg name='cmd' type='const char *' info='the command which will be
passed to QEMU monitor'/>
<arg name='flags' type='unsigned int' info='an OR'ed set of
virDomainQemuMonitorCommandFlags'/>
</function>
<function name='virDomainQemuAgentCommand' file='python-qemu'>
<info>Send a Guest Agent command to domain</info>
- <return type='str *' info='the command output'/>
+ <return type='char *' info='the command output'/>
<arg name='domain' type='virDomainPtr' info='pointer to the domain'/>
<arg name='cmd' type='const char *' info='guest agent command on
domain'/>
<arg name='timeout' type='int' info='timeout seconds'/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/libvirt-qemu-override.c
new/libvirt-python-6.6.0/libvirt-qemu-override.c
--- old/libvirt-python-6.5.0/libvirt-qemu-override.c 2020-01-15
16:20:01.000000000 +0100
+++ new/libvirt-python-6.6.0/libvirt-qemu-override.c 2020-08-03
00:17:46.000000000 +0200
@@ -36,7 +36,7 @@
printf(fmt, __VA_ARGS__)
#else
# define DEBUG(fmt, ...) \
- do {} while (0)
+ while (0) {printf(fmt, __VA_ARGS__);}
#endif
/*******************************************
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/libvirtaio.py
new/libvirt-python-6.6.0/libvirtaio.py
--- old/libvirt-python-6.5.0/libvirtaio.py 2018-09-03 19:31:03.000000000
+0200
+++ new/libvirt-python-6.6.0/libvirtaio.py 2020-08-03 00:17:46.000000000
+0200
@@ -370,13 +370,13 @@
https://libvirt.org/html/libvirt-libvirt-event.html#virEventUpdateHandleFunc
'''
self.log.debug('update_handle(watch=%d, event=%d)', watch, event)
- return self.callbacks[watch].update(event=event)
+ self.callbacks[watch].update(event=event)
def _remove_handle(self, watch):
'''Unregister a callback from a file handle.
:param int watch: file descriptor watch to stop listening on
- :returns: None (see source for explanation)
+ :returns: -1 on error, 0 on success
.. seealso::
https://libvirt.org/html/libvirt-libvirt-event.html#virEventRemoveHandleFunc
@@ -386,12 +386,13 @@
callback = self.callbacks.pop(watch)
except KeyError as err:
self.log.warning('remove_handle(): no such handle: %r',
err.args[0])
- raise
+ return -1
fd = callback.descriptor.fd
assert callback is self.descriptors[fd].remove_handle(watch)
if len(self.descriptors[fd].callbacks) == 0:
del self.descriptors[fd]
callback.close()
+ return 0
def _add_timeout(self, timeout, cb, opaque):
'''Register a callback for a timer event
@@ -425,20 +426,25 @@
https://libvirt.org/html/libvirt-libvirt-event.html#virEventUpdateTimeoutFunc
'''
self.log.debug('update_timeout(timer=%d, timeout=%d)', timer, timeout)
- return self.callbacks[timer].update(timeout=timeout)
+ self.callbacks[timer].update(timeout=timeout)
def _remove_timeout(self, timer):
'''Unregister a callback for a timer
:param int timer: the timer to remove
- :returns: None (see source for explanation)
+ :returns: -1 on error, 0 on success
.. seealso::
https://libvirt.org/html/libvirt-libvirt-event.html#virEventRemoveTimeoutFunc
'''
self.log.debug('remove_timeout(timer=%d)', timer)
- callback = self.callbacks.pop(timer)
+ try:
+ callback = self.callbacks.pop(timer)
+ except KeyError as err:
+ self.log.warning('remove_timeout(): no such timeout: %r',
err.args[0])
+ return -1
callback.close()
+ return 0
_current_impl = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/setup.py
new/libvirt-python-6.6.0/setup.py
--- old/libvirt-python-6.5.0/setup.py 2020-07-03 08:52:42.000000000 +0200
+++ new/libvirt-python-6.6.0/setup.py 2020-08-03 00:18:46.000000000 +0200
@@ -339,7 +339,7 @@
_c_modules, _py_modules = get_module_lists()
setup(name = 'libvirt-python',
- version = '6.5.0',
+ version = '6.6.0',
url = 'http://www.libvirt.org',
maintainer = 'Libvirt Maintainers',
maintainer_email = '[email protected]',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-6.5.0/typewrappers.h
new/libvirt-python-6.6.0/typewrappers.h
--- old/libvirt-python-6.5.0/typewrappers.h 2020-01-15 16:20:01.000000000
+0100
+++ new/libvirt-python-6.6.0/typewrappers.h 2020-08-03 00:17:46.000000000
+0200
@@ -276,3 +276,7 @@
if (PyEval_ThreadsInitialized()) \
PyGILState_Release(_save); \
} LIBVIRT_STMT_END
+
+#ifndef NULLSTR
+#define NULLSTR(s) ((s) ? (s) : "<null>")
+#endif
++++++ python-libvirt-python.keyring ++++++
--- /var/tmp/diff_new_pack.DsdmMN/_old 2020-08-13 10:14:51.430667431 +0200
+++ /var/tmp/diff_new_pack.DsdmMN/_new 2020-08-13 10:14:51.434667433 +0200
@@ -178,4 +178,52 @@
Rga4pd6VvB8HZUdQRwABATrDAJ48v66qkzGGLR2mH2C7SFw0y4OYSACghuQ7BYTNAlVFM7fT
lvOUhgA69SI=
=aP5f
------END PGP PUBLIC KEY BLOCK-----
\ No newline at end of file
+-----END PGP PUBLIC KEY BLOCK-----
+
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+
+mQINBF8VqoQBEACcjMco80+TaJU8JYCiOSPZb2a9pKSvz8I7wGqa+awcELWnTGTS1A66KneU
+NzEZlmXaL/OZ6n+KtMT+2V6hqBeG8+p/GbCDzr+ThwcdlUvQ9p15hiHV5IRPXgX15ltXB40+
+HEDQsj7iaZD14PmD/5QewfuGa/wEkGtPJjY+6+7ARE+JVdvG0Tzj9hlKlVJnJrEZELZh2+MF
+sRqtQPwx4h7JFZikLg1KHG8ewdo5zYjRLVrId334fu+cqvLa6dqXoM9adW5V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