Hello community,
here is the log from the commit of package python-libvirt-python for
openSUSE:Factory checked in at 2020-01-23 16:07:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-libvirt-python (Old)
and /work/SRC/openSUSE:Factory/.python-libvirt-python.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-libvirt-python"
Thu Jan 23 16:07:51 2020 rev:30 rq:765097 version:6.0.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-libvirt-python/python-libvirt-python.changes
2019-12-07 15:17:52.867774660 +0100
+++
/work/SRC/openSUSE:Factory/.python-libvirt-python.new.26092/python-libvirt-python.changes
2020-01-23 16:07:57.307530634 +0100
@@ -1,0 +2,9 @@
+Wed Jan 15 19:33:21 UTC 2020 - James Fehlig <[email protected]>
+
+- Update to 6.0.0
+ - Add all new APIs and constants in libvirt 6.0.0
+ - Revert commit b22e4f24 to retain python2 support a bit longer
+ on SUSE
+ revert-b22e4f24.patch
+
+-------------------------------------------------------------------
Old:
----
libvirt-python-5.10.0.tar.gz
libvirt-python-5.10.0.tar.gz.asc
New:
----
libvirt-python-6.0.0.tar.gz
libvirt-python-6.0.0.tar.gz.asc
revert-b22e4f24.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-libvirt-python.spec ++++++
--- /var/tmp/diff_new_pack.SCbiZ1/_old 2020-01-23 16:07:58.215531172 +0100
+++ /var/tmp/diff_new_pack.SCbiZ1/_new 2020-01-23 16:07:58.219531175 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-libvirt-python
#
-# Copyright (c) 2019 SUSE LLC.
+# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
%define srcname libvirt-python
Name: python-libvirt-python
URL: https://libvirt.org/
-Version: 5.10.0
+Version: 6.0.0
Release: 0
Summary: Library providing a virtualization API
License: LGPL-2.1-or-later
@@ -28,6 +28,7 @@
Source0: %{srcname}-%{version}.tar.gz
Source1: %{srcname}-%{version}.tar.gz.asc
Source2: python-libvirt-python.keyring
+Patch0: revert-b22e4f24.patch
BuildRequires: fdupes
BuildRequires: libvirt-devel = %{version}
BuildRequires: python-rpm-macros
@@ -49,6 +50,7 @@
%prep
%setup -q -n %{srcname}-%{version}
+%patch0 -p1
# Unset execute bit for example scripts; it can introduce spurious
# RPM dependencies, like /usr/bin/python which can pull in python2
++++++ libvirt-python-5.10.0.tar.gz -> libvirt-python-6.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/ChangeLog
new/libvirt-python-6.0.0/ChangeLog
--- old/libvirt-python-5.10.0/ChangeLog 2019-12-02 20:45:48.000000000 +0100
+++ new/libvirt-python-6.0.0/ChangeLog 2020-01-15 16:22:50.000000000 +0100
@@ -1,3 +1,48 @@
+2020-01-03 Daniel P. Berrangé <[email protected]>
+
+ Add overrides for network port UUID getter/lookup methods
+ The generator creates broken code for all these methods.
+
+ Reviewed-by: Fabiano Fidêncio <[email protected]>
+
+
+2020-01-03 Daniel P. Berrangé <[email protected]>
+
+ fix class type instantiated when listing network ports
+ Reviewed-by: Erik Skultety <[email protected]>
+
+
+2019-12-09 Andrea Bolognani <[email protected]>
+
+ setup: Accept 'nosetests3' as nosetests binary
+ This is the name used on Ubuntu.
+
+ Reviewed-by: Daniel P. Berrangé <[email protected]>
+
+
+2019-12-06 Daniel P. Berrangé <[email protected]>
+
+ Fix RPM deps for centos 7
+ Reviewed-by: Andrea Bolognani <[email protected]>
+
+
+2019-12-04 Daniel P. Berrangé <[email protected]>
+
+ Drop support for python 2
+ python2 will be end of life by the time of the next
+ libvirt release. All our supported build targets, including
+ CentOS7, have a python3 build available.
+
+ Reviewed-by: Michal Privoznik <[email protected]>
+
+
+2019-12-02 Daniel Veillard <[email protected]>
+
+ Release of libvirt-python 5.10.0
+ * setup.py: update for release
+
+
+
2019-11-28 Pavel Hrdina <[email protected]>
generator.py: add mapping for VIR_DOMAIN_QEMU_AGENT_COMMAND_*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/PKG-INFO
new/libvirt-python-6.0.0/PKG-INFO
--- old/libvirt-python-5.10.0/PKG-INFO 2019-12-02 20:45:48.000000000 +0100
+++ new/libvirt-python-6.0.0/PKG-INFO 2020-01-15 16:22:50.000000000 +0100
@@ -1,13 +1,13 @@
Metadata-Version: 1.1
Name: libvirt-python
-Version: 5.10.0
+Version: 6.0.0
Summary: The libvirt virtualization API python binding
Home-page: http://www.libvirt.org
Author: Libvirt Maintainers
Author-email: [email protected]
License: LGPLv2+
Description: The libvirt-python package provides a module that permits
applications
- written in the Python programming language to call the interface
+ written in the Python 3.x programming language to call the interface
supplied by the libvirt library, to manage the virtualization
capabilities
of recent versions of Linux (and other OSes).
Platform: UNKNOWN
@@ -15,5 +15,4 @@
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or
later (LGPLv2+)
Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/examples/consolecallback.py
new/libvirt-python-6.0.0/examples/consolecallback.py
--- old/libvirt-python-5.10.0/examples/consolecallback.py 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/examples/consolecallback.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# consolecallback - provide a persistent console that survives guest reboots
import sys, os, logging, libvirt, tty, termios, atexit
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/examples/dominfo.py
new/libvirt-python-6.0.0/examples/dominfo.py
--- old/libvirt-python-5.10.0/examples/dominfo.py 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/examples/dominfo.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# dominfo - print some information about a domain
import libvirt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/examples/domipaddrs.py
new/libvirt-python-6.0.0/examples/domipaddrs.py
--- old/libvirt-python-5.10.0/examples/domipaddrs.py 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/examples/domipaddrs.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# domipaddrs - print domain interfaces along with their MAC and IP addresses
import libvirt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/examples/domrestore.py
new/libvirt-python-6.0.0/examples/domrestore.py
--- old/libvirt-python-5.10.0/examples/domrestore.py 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/examples/domrestore.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# domstart - make sure a given domU is running, if not start it
import libvirt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/examples/domsave.py
new/libvirt-python-6.0.0/examples/domsave.py
--- old/libvirt-python-5.10.0/examples/domsave.py 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/examples/domsave.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# domstart - make sure a given domU is running, if not start it
import libvirt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/examples/domstart.py
new/libvirt-python-6.0.0/examples/domstart.py
--- old/libvirt-python-5.10.0/examples/domstart.py 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/examples/domstart.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# domstart - make sure a given domU is running, if not start it
import libvirt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/examples/esxlist.py
new/libvirt-python-6.0.0/examples/esxlist.py
--- old/libvirt-python-5.10.0/examples/esxlist.py 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/examples/esxlist.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# esxlist - list active domains of an ESX host and print some info.
# also demonstrates how to use the libvirt.openAuth() method
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/examples/event-test.py
new/libvirt-python-6.0.0/examples/event-test.py
--- old/libvirt-python-5.10.0/examples/event-test.py 2018-12-03
13:18:19.000000000 +0100
+++ new/libvirt-python-6.0.0/examples/event-test.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
#
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libvirt-python-5.10.0/examples/guest-vcpus/guest-vcpu-daemon.py
new/libvirt-python-6.0.0/examples/guest-vcpus/guest-vcpu-daemon.py
--- old/libvirt-python-5.10.0/examples/guest-vcpus/guest-vcpu-daemon.py
2018-09-03 19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/examples/guest-vcpus/guest-vcpu-daemon.py
2020-01-15 16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import libvirt
import threading
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/libvirt-python-5.10.0/examples/guest-vcpus/guest-vcpu.py
new/libvirt-python-6.0.0/examples/guest-vcpus/guest-vcpu.py
--- old/libvirt-python-5.10.0/examples/guest-vcpus/guest-vcpu.py
2018-09-03 19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/examples/guest-vcpus/guest-vcpu.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import libvirt
import sys
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/examples/nodestats.py
new/libvirt-python-6.0.0/examples/nodestats.py
--- old/libvirt-python-5.10.0/examples/nodestats.py 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/examples/nodestats.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Print some host NUMA node statistics
#
# Authors:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/examples/topology.py
new/libvirt-python-6.0.0/examples/topology.py
--- old/libvirt-python-5.10.0/examples/topology.py 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/examples/topology.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Parse topology information from the capabilities XML and use
# them to calculate host topology
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/generator.py
new/libvirt-python-6.0.0/generator.py
--- old/libvirt-python-5.10.0/generator.py 2019-12-02 20:45:06.000000000
+0100
+++ new/libvirt-python-6.0.0/generator.py 2020-01-15 16:20:01.000000000
+0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# generate python wrappers from the XML API description
#
@@ -430,6 +430,9 @@
'virNetworkGetUUID',
'virNetworkGetUUIDString',
'virNetworkLookupByUUID',
+ 'virNetworkPortGetUUID',
+ 'virNetworkPortGetUUIDString',
+ 'virNetworkPortLookupByUUID',
'virDomainGetAutostart',
'virNetworkGetAutostart',
'virDomainBlockStats',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/libvirt-lxc-override.c
new/libvirt-python-6.0.0/libvirt-lxc-override.c
--- old/libvirt-python-5.10.0/libvirt-lxc-override.c 2019-07-02
22:37:42.000000000 +0200
+++ new/libvirt-python-6.0.0/libvirt-lxc-override.c 2020-01-15
16:20:01.000000000 +0100
@@ -4,13 +4,13 @@
* entry points where an automatically generated stub is
* unpractical
*
- * Copyright (C) 2012-2013 Red Hat, Inc.
+ * Copyright (C) 2012-2019 Red Hat, Inc.
*
* Daniel Veillard <[email protected]>
*/
/* Horrible kludge to work around even more horrible name-space pollution
- via Python.h. That file includes /usr/include/python2.5/pyconfig*.h,
+ via Python.h. That file includes /usr/include/python3.x/pyconfig*.h,
which has over 180 autoconf-style HAVE_* definitions. Shame on them. */
#undef HAVE_PTHREAD_H
@@ -21,18 +21,10 @@
#include "libvirt-utils.h"
#include "build/libvirt-lxc.h"
-#if PY_MAJOR_VERSION > 2
-# ifndef __CYGWIN__
+#ifndef __CYGWIN__
extern PyObject *PyInit_libvirtmod_lxc(void);
-# else
-extern PyObject *PyInit_cygvirtmod_lxc(void);
-# endif
#else
-# ifndef __CYGWIN__
-extern void initlibvirtmod_lxc(void);
-# else
-extern void initcygvirtmod_lxc(void);
-# endif
+extern PyObject *PyInit_cygvirtmod_lxc(void);
#endif
#if 0
@@ -107,14 +99,13 @@
{NULL, NULL, 0, NULL}
};
-#if PY_MAJOR_VERSION > 2
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
-# ifndef __CYGWIN__
+#ifndef __CYGWIN__
"libvirtmod_lxc",
-# else
+#else
"cygvirtmod_lxc",
-# endif
+#endif
NULL,
-1,
libvirtLxcMethods,
@@ -125,11 +116,11 @@
};
PyObject *
-# ifndef __CYGWIN__
+#ifndef __CYGWIN__
PyInit_libvirtmod_lxc
-# else
+#else
PyInit_cygvirtmod_lxc
-# endif
+#endif
(void)
{
PyObject *module;
@@ -141,25 +132,3 @@
return module;
}
-#else /* ! PY_MAJOR_VERSION > 2 */
-void
-# ifndef __CYGWIN__
-initlibvirtmod_lxc
-# else
-initcygvirtmod_lxc
-# endif
-(void)
-{
- if (virInitialize() < 0)
- return;
-
- /* initialize the python extension module */
- Py_InitModule((char *)
-# ifndef __CYGWIN__
- "libvirtmod_lxc",
-# else
- "cygvirtmod_lxc",
-# endif
- libvirtLxcMethods);
-}
-#endif /* ! PY_MAJOR_VERSION > 2 */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/libvirt-override-api.xml
new/libvirt-python-6.0.0/libvirt-override-api.xml
--- old/libvirt-python-5.10.0/libvirt-override-api.xml 2019-10-05
09:53:03.000000000 +0200
+++ new/libvirt-python-6.0.0/libvirt-override-api.xml 2020-01-15
16:20:01.000000000 +0100
@@ -64,6 +64,12 @@
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor
connection'/>
<arg name='uuid' type='const unsigned char *' info='the UUID string for
the network, must be 16 bytes'/>
</function>
+ <function name='virNetworkPortLookupByUUID' file='python'>
+ <info>Try to lookup a port on the given network based on its UUID.</info>
+ <return type='virNetworkPortPtr' info='a new network port object or NULL
in case of failure'/>
+ <arg name='net' type='virNetworkPtr' info='pointer to the network
object'/>
+ <arg name='uuid' type='const unsigned char *' info='the UUID string for
the network port, must be 16 bytes'/>
+ </function>
<function name='virDomainGetInfo' file='python'>
<info>Extract information about a domain. Note that if the connection
used to get the domain is limited only a partial set of the information can be
extracted.</info>
<return type='char *' info='the list of information or None in case of
error'/>
@@ -153,6 +159,16 @@
<return type='char *' info='the UUID string or None in case of error'/>
<arg name='net' type='virNetworkPtr' info='a network object'/>
</function>
+ <function name='virNetworkPortGetUUID' file='python'>
+ <info>Extract the UUID unique Identifier of a network port.</info>
+ <return type='char *' info='the 16 bytes string or None in case of
error'/>
+ <arg name='domain' type='virNetworkPortPtr' info='a network port
object'/>
+ </function>
+ <function name='virNetworkPortGetUUIDString' file='python'>
+ <info>Fetch globally unique ID of the network port as a string.</info>
+ <return type='char *' info='the UUID string or None in case of error'/>
+ <arg name='net' type='virNetworkPortPtr' info='a network port object'/>
+ </function>
<function name='virStoragePoolGetUUID' file='python'>
<info>Extract the UUID unique Identifier of a storage pool.</info>
<return type='char *' info='the 16 bytes string or None in case of
error'/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/libvirt-override-virNetwork.py
new/libvirt-python-6.0.0/libvirt-override-virNetwork.py
--- old/libvirt-python-5.10.0/libvirt-override-virNetwork.py 2019-07-02
22:37:42.000000000 +0200
+++ new/libvirt-python-6.0.0/libvirt-override-virNetwork.py 2020-01-15
16:20:01.000000000 +0100
@@ -1,11 +1,11 @@
def listAllPorts(self, flags=0):
- """List all domains and returns a list of domain objects"""
+ """List all ports on the network and returns a list of network port
objects"""
ret = libvirtmod.virNetworkListAllPorts(self._o, flags)
if ret is None:
raise libvirtError("virNetworkListAllPorts() failed", conn=self)
retlist = list()
for domptr in ret:
- retlist.append(virNetwork(self, _obj=domptr))
+ retlist.append(virNetworkPort(self, _obj=domptr))
return retlist
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/libvirt-override.c
new/libvirt-python-6.0.0/libvirt-override.c
--- old/libvirt-python-5.10.0/libvirt-override.c 2019-10-05
09:53:03.000000000 +0200
+++ new/libvirt-python-6.0.0/libvirt-override.c 2020-01-15 16:20:01.000000000
+0100
@@ -4,13 +4,13 @@
* entry points where an automatically generated stub is
* unpractical
*
- * Copyright (C) 2005, 2007-2015 Red Hat, Inc.
+ * Copyright (C) 2005-2019 Red Hat, Inc.
*
* Daniel Veillard <[email protected]>
*/
/* Horrible kludge to work around even more horrible name-space pollution
- via Python.h. That file includes /usr/include/python2.5/pyconfig*.h,
+ via Python.h. That file includes /usr/include/python3.x/pyconfig*.h,
which has over 180 autoconf-style HAVE_* definitions. Shame on them. */
#undef HAVE_PTHREAD_H
@@ -25,18 +25,10 @@
#include "build/libvirt.h"
#include "libvirt-utils.h"
-#if PY_MAJOR_VERSION > 2
-# ifndef __CYGWIN__
+#ifndef __CYGWIN__
extern PyObject *PyInit_libvirtmod(void);
-# else
-extern PyObject *PyInit_cygvirtmod(void);
-# endif
#else
-# ifndef __CYGWIN__
-extern void initlibvirtmod(void);
-# else
-extern void initcygvirtmod(void);
-# endif
+extern PyObject *PyInit_cygvirtmod(void);
#endif
#if 0
@@ -10193,6 +10185,86 @@
virTypedParamsFree(params, nparams);
return dict;
}
+
+static PyObject *
+libvirt_virNetworkPortGetUUID(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args)
+{
+ unsigned char uuid[VIR_UUID_BUFLEN];
+ virNetworkPortPtr port;
+ PyObject *pyobj_port;
+ int c_retval;
+
+ if (!PyArg_ParseTuple(args, (char *)"O:virNetworkPortGetUUID",
&pyobj_port))
+ return NULL;
+ port = (virNetworkPortPtr) PyvirNetworkPort_Get(pyobj_port);
+
+ if (port == NULL)
+ return VIR_PY_NONE;
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ c_retval = virNetworkPortGetUUID(port, &uuid[0]);
+ LIBVIRT_END_ALLOW_THREADS;
+
+ if (c_retval < 0)
+ return VIR_PY_NONE;
+
+ return libvirt_charPtrSizeWrap((char *) &uuid[0], VIR_UUID_BUFLEN);
+}
+
+static PyObject *
+libvirt_virNetworkPortGetUUIDString(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args)
+{
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+ virNetworkPortPtr port;
+ PyObject *pyobj_port;
+ int c_retval;
+
+ if (!PyArg_ParseTuple(args, (char *)"O:virNetworkPortGetUUIDString",
+ &pyobj_port))
+ return NULL;
+ port = (virNetworkPortPtr) PyvirNetworkPort_Get(pyobj_port);
+
+ if (port == NULL)
+ return VIR_PY_NONE;
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ c_retval = virNetworkPortGetUUIDString(port, &uuidstr[0]);
+ LIBVIRT_END_ALLOW_THREADS;
+
+ if (c_retval < 0)
+ return VIR_PY_NONE;
+
+ return libvirt_constcharPtrWrap((char *) &uuidstr[0]);
+}
+
+static PyObject *
+libvirt_virNetworkPortLookupByUUID(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args)
+{
+ virNetworkPortPtr c_retval;
+ virNetworkPtr net;
+ PyObject *pyobj_net;
+ unsigned char *uuid;
+ int len;
+
+ if (!PyArg_ParseTuple(args, (char *)"Oz#:virNetworkPortLookupByUUID",
+ &pyobj_net, &uuid, &len))
+ return NULL;
+ net = (virNetworkPtr) PyvirNetwork_Get(pyobj_net);
+
+ if ((uuid == NULL) || (len != VIR_UUID_BUFLEN))
+ return VIR_PY_NONE;
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ c_retval = virNetworkPortLookupByUUID(net, uuid);
+ LIBVIRT_END_ALLOW_THREADS;
+
+ return libvirt_virNetworkPortPtrWrap((virNetworkPortPtr) c_retval);
+}
+
+
#endif /* LIBVIR_CHECK_VERSION(5, 5, 0) */
#if LIBVIR_CHECK_VERSION(5, 7, 0)
@@ -10543,6 +10615,9 @@
{(char *) "virNetworkListAllPorts", libvirt_virNetworkListAllPorts,
METH_VARARGS, NULL},
{(char *) "virNetworkPortSetParameters",
libvirt_virNetworkPortSetParameters, METH_VARARGS, NULL},
{(char *) "virNetworkPortGetParameters",
libvirt_virNetworkPortGetParameters, METH_VARARGS, NULL},
+ {(char *) "virNetworkPortGetUUID", libvirt_virNetworkPortGetUUID,
METH_VARARGS, NULL},
+ {(char *) "virNetworkPortGetUUIDString",
libvirt_virNetworkPortGetUUIDString, METH_VARARGS, NULL},
+ {(char *) "virNetworkPortLookupByUUID",
libvirt_virNetworkPortLookupByUUID, METH_VARARGS, NULL},
#endif /* LIBVIR_CHECK_VERSION(5, 5, 0) */
#if LIBVIR_CHECK_VERSION(5, 7, 0)
{(char *) "virDomainGetGuestInfo", libvirt_virDomainGetGuestInfo,
METH_VARARGS, NULL},
@@ -10553,14 +10628,13 @@
{NULL, NULL, 0, NULL}
};
-#if PY_MAJOR_VERSION > 2
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
-# ifndef __CYGWIN__
+#ifndef __CYGWIN__
"libvirtmod",
-# else
+#else
"cygvirtmod",
-# endif
+#endif
NULL,
-1,
libvirtMethods,
@@ -10571,11 +10645,11 @@
};
PyObject *
-# ifndef __CYGWIN__
+#ifndef __CYGWIN__
PyInit_libvirtmod
-# else
+#else
PyInit_cygvirtmod
-# endif
+#endif
(void)
{
PyObject *module;
@@ -10587,25 +10661,3 @@
return module;
}
-#else /* ! PY_MAJOR_VERSION > 2 */
-void
-# ifndef __CYGWIN__
-initlibvirtmod
-# else
-initcygvirtmod
-# endif
-(void)
-{
- if (virInitialize() < 0)
- return;
-
- /* initialize the python extension module */
- Py_InitModule((char *)
-# ifndef __CYGWIN__
- "libvirtmod",
-# else
- "cygvirtmod",
-# endif
- libvirtMethods);
-}
-#endif /* ! PY_MAJOR_VERSION > 2 */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/libvirt-python.spec
new/libvirt-python-6.0.0/libvirt-python.spec
--- old/libvirt-python-5.10.0/libvirt-python.spec 2019-12-02
20:45:47.000000000 +0100
+++ new/libvirt-python-6.0.0/libvirt-python.spec 2020-01-15
16:22:50.000000000 +0100
@@ -12,58 +12,26 @@
%define supported_platform 0
%endif
-%define _with_python2 1
-%if 0%{?fedora} > 30 || 0%{?rhel} > 7
-%define _with_python2 0
-%endif
-
-%define _with_python3 0
-%if 0%{?fedora} || 0%{?rhel} > 7
-%define _with_python3 1
-%endif
-
-# Whether py2 packages are assumed to have python2- name prefix
-%define py2_versioned_deps 0
-%if 0%{?fedora} || 0%{?rhel} > 7
-%define py2_versioned_deps 1
-%endif
-
-%{!?with_python2: %define with_python2 %{_with_python2}}
-%{!?with_python3: %define with_python3 %{_with_python3}}
-
-Summary: The libvirt virtualization API python2 binding
+Summary: The libvirt virtualization API python3 binding
Name: libvirt-python
-Version: 5.10.0
+Version: 6.0.0
Release: 1%{?dist}
Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
Url: http://libvirt.org
License: LGPLv2+
BuildRequires: libvirt-devel == %{version}
-%if %{with_python2}
-%if %{py2_versioned_deps}
-BuildRequires: python2-devel
-BuildRequires: python2-nose
-BuildRequires: python2-lxml
-%else
-BuildRequires: python-devel
-BuildRequires: python-nose
-BuildRequires: python-lxml
-%endif
-%endif
-%if %{with_python3}
BuildRequires: python3-devel
+%if 0%{?rhel} == 7
+BuildRequires: python36-nose
+BuildRequires: python36-lxml
+%else
BuildRequires: python3-nose
BuildRequires: python3-lxml
%endif
BuildRequires: gcc
# Don't want provides for python shared objects
-%if %{with_python2}
-%{?filter_provides_in: %filter_provides_in %{python2_sitearch}/.*\.so}
-%endif
-%if %{with_python3}
%{?filter_provides_in: %filter_provides_in %{python3_sitearch}/.*\.so}
-%endif
%{?filter_setup}
%description
@@ -72,23 +40,6 @@
supplied by the libvirt library to use the virtualization capabilities
of recent versions of Linux (and other OSes).
-%if %{with_python2}
-%package -n python2-libvirt
-Summary: The libvirt virtualization API python2 binding
-Url: http://libvirt.org
-License: LGPLv2+
-%{?python_provide:%python_provide python2-libvirt}
-Provides: libvirt-python = %{version}-%{release}
-Obsoletes: libvirt-python <= 3.6.0-1%{?dist}
-
-%description -n python2-libvirt
-The python2-libvirt package contains a module that permits applications
-written in the Python programming language to use the interface
-supplied by the libvirt library to use the virtualization capabilities
-of recent versions of Linux (and other OSes).
-%endif
-
-%if %{with_python3}
%package -n python3-libvirt
Summary: The libvirt virtualization API python3 binding
Url: http://libvirt.org
@@ -99,16 +50,15 @@
%description -n python3-libvirt
The python3-libvirt package contains a module that permits applications
-written in the Python programming language to use the interface
+written in the Python 3.x programming language to use the interface
supplied by the libvirt library to use the virtualization capabilities
of recent versions of Linux (and other OSes).
-%endif
%prep
%setup -q
# Unset execute bit for example scripts; it can introduce spurious
-# RPM dependencies, like /usr/bin/python which can pull in python2
+# RPM dependencies, like /usr/bin/python3
# for the -python3 package
find examples -type f -exec chmod 0644 \{\} \;
@@ -118,56 +68,22 @@
exit 1
%endif
-%if %{with_python2}
-%if 0%{?fedora} || 0%{?rhel} >= 8
-%py2_build
-%else
-CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
-%endif
-%endif
-%if %{with_python3}
%if 0%{?fedora} || 0%{?rhel} >= 8
%py3_build
%else
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
%endif
-%endif
%install
-%if %{with_python2}
-%if 0%{?fedora} || 0%{?rhel} >= 8
-%py2_install
-%else
-%{__python2} setup.py install --skip-build --root=%{buildroot}
-%endif
-%endif
-%if %{with_python3}
%if 0%{?fedora} || 0%{?rhel} >= 8
%py3_install
%else
%{__python3} setup.py install --skip-build --root=%{buildroot}
%endif
-%endif
%check
-%if %{with_python2}
-%{__python2} setup.py test
-%endif
-%if %{with_python3}
%{__python3} setup.py test
-%endif
-%if %{with_python2}
-%files -n python2-libvirt
-%doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
-%{python2_sitearch}/libvirt.py*
-%{python2_sitearch}/libvirt_qemu.py*
-%{python2_sitearch}/libvirt_lxc.py*
-%{python2_sitearch}/libvirtmod*
-%{python2_sitearch}/*egg-info
-%endif
-
-%if %{with_python3}
%files -n python3-libvirt
%doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
%{python3_sitearch}/libvirt.py*
@@ -180,6 +96,5 @@
%{python3_sitearch}/__pycache__/libvirtaio.cpython-*.py*
%{python3_sitearch}/libvirtmod*
%{python3_sitearch}/*egg-info
-%endif
%changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/libvirt-qemu-override.c
new/libvirt-python-6.0.0/libvirt-qemu-override.c
--- old/libvirt-python-5.10.0/libvirt-qemu-override.c 2018-09-03
19:31:03.000000000 +0200
+++ new/libvirt-python-6.0.0/libvirt-qemu-override.c 2020-01-15
16:20:01.000000000 +0100
@@ -4,13 +4,13 @@
* entry points where an automatically generated stub is
* unpractical
*
- * Copyright (C) 2011-2014 Red Hat, Inc.
+ * Copyright (C) 2011-2019 Red Hat, Inc.
*
* Daniel Veillard <[email protected]>
*/
/* Horrible kludge to work around even more horrible name-space pollution
- via Python.h. That file includes /usr/include/python2.5/pyconfig*.h,
+ via Python.h. That file includes /usr/include/python3.x/pyconfig*.h,
which has over 180 autoconf-style HAVE_* definitions. Shame on them. */
#undef HAVE_PTHREAD_H
@@ -21,18 +21,10 @@
#include "libvirt-utils.h"
#include "build/libvirt-qemu.h"
-#if PY_MAJOR_VERSION > 2
-# ifndef __CYGWIN__
+#ifndef __CYGWIN__
extern PyObject *PyInit_libvirtmod_qemu(void);
-# else
-extern PyObject *PyInit_cygvirtmod_qemu(void);
-# endif
#else
-# ifndef __CYGWIN__
-extern void initlibvirtmod_qemu(void);
-# else
-extern void initcygvirtmod_qemu(void);
-# endif
+extern PyObject *PyInit_cygvirtmod_qemu(void);
#endif
#if 0
@@ -351,14 +343,13 @@
{NULL, NULL, 0, NULL}
};
-#if PY_MAJOR_VERSION > 2
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
-# ifndef __CYGWIN__
+#ifndef __CYGWIN__
"libvirtmod_qemu",
-# else
+#else
"cygvirtmod_qemu",
-# endif
+#endif
NULL,
-1,
libvirtQemuMethods,
@@ -369,11 +360,11 @@
};
PyObject *
-# ifndef __CYGWIN__
+#ifndef __CYGWIN__
PyInit_libvirtmod_qemu
-# else
+#else
PyInit_cygvirtmod_qemu
-# endif
+#endif
(void)
{
PyObject *module;
@@ -385,25 +376,3 @@
return module;
}
-#else /* ! PY_MAJOR_VERSION > 2 */
-void
-# ifndef __CYGWIN__
-initlibvirtmod_qemu
-# else
-initcygvirtmod_qemu
-# endif
-(void)
-{
- if (virInitialize() < 0)
- return;
-
- /* initialize the python extension module */
- Py_InitModule((char *)
-# ifndef __CYGWIN__
- "libvirtmod_qemu",
-# else
- "cygvirtmod_qemu",
-# endif
- libvirtQemuMethods);
-}
-#endif /* ! PY_MAJOR_VERSION > 2 */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/libvirt-utils.c
new/libvirt-python-6.0.0/libvirt-utils.c
--- old/libvirt-python-5.10.0/libvirt-utils.c 2018-09-03 19:31:03.000000000
+0200
+++ new/libvirt-python-6.0.0/libvirt-utils.c 2020-01-15 16:20:01.000000000
+0100
@@ -1,7 +1,7 @@
/*
* libvirt-utils.c: misc helper APIs for python binding
*
- * Copyright (C) 2013 Red Hat, Inc.
+ * Copyright (C) 2013-2019 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -274,11 +274,7 @@
int nparams)
{
PyObject *key, *value;
-#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 4
- int pos = 0;
-#else
Py_ssize_t pos = 0;
-#endif
virTypedParameterPtr temp = NULL, ret = NULL;
Py_ssize_t size;
ssize_t i;
@@ -416,13 +412,6 @@
type = VIR_TYPED_PARAM_LLONG;
else
type = VIR_TYPED_PARAM_ULLONG;
-#if PY_MAJOR_VERSION < 3
- } else if (PyInt_Check(value)) {
- if (PyInt_AS_LONG(value) < 0)
- type = VIR_TYPED_PARAM_LLONG;
- else
- type = VIR_TYPED_PARAM_ULLONG;
-#endif
} else if (PyFloat_Check(value)) {
type = VIR_TYPED_PARAM_DOUBLE;
}
@@ -520,11 +509,7 @@
{
PyObject *key;
PyObject *value;
-#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 4
- int pos = 0;
-#else
Py_ssize_t pos = 0;
-#endif
virTypedParameterPtr params = NULL;
int n = 0;
int max = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/libvirt-utils.h
new/libvirt-python-6.0.0/libvirt-utils.h
--- old/libvirt-python-5.10.0/libvirt-utils.h 2018-09-03 19:31:03.000000000
+0200
+++ new/libvirt-python-6.0.0/libvirt-utils.h 2020-01-15 16:20:01.000000000
+0100
@@ -139,11 +139,7 @@
void virFree(void *ptrptr) ATTRIBUTE_NONNULL(1);
-# if PY_MAJOR_VERSION > 2
-# define libvirt_PyString_Check PyUnicode_Check
-# else
-# define libvirt_PyString_Check PyString_Check
-# endif
+# define libvirt_PyString_Check PyUnicode_Check
#define VIR_N_ELEMENTS(array) (sizeof(array) / sizeof(*(array)))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/sanitytest.py
new/libvirt-python-6.0.0/sanitytest.py
--- old/libvirt-python-5.10.0/sanitytest.py 2019-10-05 09:53:03.000000000
+0200
+++ new/libvirt-python-6.0.0/sanitytest.py 2020-01-15 16:20:01.000000000
+0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys
import lxml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/setup.py
new/libvirt-python-6.0.0/setup.py
--- old/libvirt-python-5.10.0/setup.py 2019-12-02 20:45:41.000000000 +0100
+++ new/libvirt-python-6.0.0/setup.py 2020-01-15 16:21:06.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from distutils.core import setup, Extension, Command
from distutils.command.build import build
@@ -17,6 +17,10 @@
import shutil
import time
+if sys.version_info[0] != 3:
+ print("libvirt-python requires Python 3.x to build")
+ sys.exit(1)
+
MIN_LIBVIRT = "0.9.11"
MIN_LIBVIRT_LXC = "1.0.2"
@@ -293,6 +297,7 @@
"nosetests-%d.%d" % (sys.version_info[0],
sys.version_info[1]),
"nosetests-%d" % (sys.version_info[0]),
+ "nosetests%d" % (sys.version_info[0]),
"nosetests",
]
@@ -334,14 +339,14 @@
_c_modules, _py_modules = get_module_lists()
setup(name = 'libvirt-python',
- version = '5.10.0',
+ version = '6.0.0',
url = 'http://www.libvirt.org',
maintainer = 'Libvirt Maintainers',
maintainer_email = '[email protected]',
description = 'The libvirt virtualization API python binding',
long_description =
'''The libvirt-python package provides a module that permits
applications
-written in the Python programming language to call the interface
+written in the Python 3.x programming language to call the interface
supplied by the libvirt library, to manage the virtualization capabilities
of recent versions of Linux (and other OSes).''',
license = 'LGPLv2+',
@@ -362,7 +367,6 @@
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v2 or
later (LGPLv2+)",
"Programming Language :: Python",
- "Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
]
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/typewrappers.c
new/libvirt-python-6.0.0/typewrappers.c
--- old/libvirt-python-5.10.0/typewrappers.c 2019-08-05 19:18:56.000000000
+0200
+++ new/libvirt-python-6.0.0/typewrappers.c 2020-01-15 16:20:01.000000000
+0100
@@ -2,141 +2,88 @@
* types.c: converter functions between the internal representation
* and the Python objects
*
- * Copyright (C) 2005, 2007, 2012 Red Hat, Inc.
+ * Copyright (C) 2005-2019 Red Hat, Inc.
*
* Daniel Veillard <[email protected]>
*/
/* Horrible kludge to work around even more horrible name-space pollution
- * via Python.h. That file includes /usr/include/python2.5/pyconfig*.h,
- * which has over 180 autoconf-style HAVE_* definitions. Shame on them.
*/
+ * via Python.h. That file includes /usr/include/python3.x/pyconfig*.h,
+ * which has over 180 autoconf-style HAVE_* definitions. Shame on them. */
#undef HAVE_PTHREAD_H
#include "typewrappers.h"
#include "libvirt-utils.h"
-#ifndef Py_CAPSULE_H
-typedef void(*PyCapsule_Destructor)(void *, void *);
-#endif
-
static PyObject *
libvirt_buildPyObject(void *cobj,
const char *name,
PyCapsule_Destructor destr)
{
- PyObject *ret;
-
-#ifdef Py_CAPSULE_H
- ret = PyCapsule_New(cobj, name, destr);
-#else
- ret = PyCObject_FromVoidPtrAndDesc(cobj, (void *) name, destr);
-#endif /* _TEST_CAPSULE */
-
- return ret;
+ return PyCapsule_New(cobj, name, destr);
}
PyObject *
libvirt_intWrap(int val)
{
- PyObject *ret;
-#if PY_MAJOR_VERSION > 2
- ret = PyLong_FromLong((long) val);
-#else
- ret = PyInt_FromLong((long) val);
-#endif
- return ret;
+ return PyLong_FromLong((long) val);
}
PyObject *
libvirt_uintWrap(uint val)
{
- PyObject *ret;
-#if PY_MAJOR_VERSION > 2
- ret = PyLong_FromLong((long) val);
-#else
- ret = PyInt_FromLong((long) val);
-#endif
- return ret;
+ return PyLong_FromLong((long) val);
}
PyObject *
libvirt_longWrap(long val)
{
- PyObject *ret;
- ret = PyLong_FromLong(val);
- return ret;
+ return PyLong_FromLong(val);
}
PyObject *
libvirt_ulongWrap(unsigned long val)
{
- PyObject *ret;
- ret = PyLong_FromLong(val);
- return ret;
+ return PyLong_FromLong(val);
}
PyObject *
libvirt_longlongWrap(long long val)
{
- PyObject *ret;
- ret = PyLong_FromLongLong(val);
- return ret;
+ return PyLong_FromLongLong(val);
}
PyObject *
libvirt_ulonglongWrap(unsigned long long val)
{
- PyObject *ret;
- ret = PyLong_FromUnsignedLongLong(val);
- return ret;
+ return PyLong_FromUnsignedLongLong(val);
}
PyObject *
libvirt_charPtrSizeWrap(char *str, Py_ssize_t size)
{
- PyObject *ret;
-
if (str == NULL) {
return VIR_PY_NONE;
}
-#if PY_MAJOR_VERSION > 2
- ret = PyBytes_FromStringAndSize(str, size);
-#else
- ret = PyString_FromStringAndSize(str, size);
-#endif
- return ret;
+ return PyBytes_FromStringAndSize(str, size);
}
PyObject *
libvirt_charPtrWrap(char *str)
{
- PyObject *ret;
-
if (str == NULL) {
return VIR_PY_NONE;
}
-#if PY_MAJOR_VERSION > 2
- ret = PyUnicode_FromString(str);
-#else
- ret = PyString_FromString(str);
-#endif
- return ret;
+ return PyUnicode_FromString(str);
}
PyObject *
libvirt_constcharPtrWrap(const char *str)
{
- PyObject *ret;
-
if (str == NULL) {
return VIR_PY_NONE;
}
-#if PY_MAJOR_VERSION > 2
- ret = PyUnicode_FromString(str);
-#else
- ret = PyString_FromString(str);
-#endif
- return ret;
+ return PyUnicode_FromString(str);
}
PyObject *
@@ -163,11 +110,7 @@
* to C long type directly. If it is of PyLong_Type, PyInt_AsLong
* will call PyLong_AsLong() to deal with it automatically.
*/
-#if PY_MAJOR_VERSION > 2
long_val = PyLong_AsLong(obj);
-#else
- long_val = PyInt_AsLong(obj);
-#endif
if ((long_val == -1) && PyErr_Occurred())
return -1;
@@ -196,11 +139,7 @@
return -1;
}
-#if PY_MAJOR_VERSION > 2
long_val = PyLong_AsLong(obj);
-#else
- long_val = PyInt_AsLong(obj);
-#endif
if ((long_val == -1) && PyErr_Occurred())
return -1;
@@ -269,14 +208,7 @@
return -1;
}
-#if PY_MAJOR_VERSION == 2
- /* If obj is of PyInt_Type, PyLong_AsLongLong
- * will call PyInt_AsLong() to handle it automatically.
- */
- if (PyInt_Check(obj) || PyLong_Check(obj))
-#else
if (PyLong_Check(obj))
-#endif
llong_val = PyLong_AsLongLong(obj);
else
PyErr_SetString(PyExc_TypeError, "an integer is required");
@@ -299,21 +231,7 @@
return -1;
}
-#if PY_MAJOR_VERSION == 2
- /* The PyLong_AsUnsignedLongLong doesn't check the type of
- * obj, only accept argument of PyLong_Type, so we check it instead.
- */
- if (PyInt_Check(obj)) {
- long long llong_val = PyInt_AsLong(obj);
- if (llong_val < 0)
- PyErr_SetString(PyExc_OverflowError,
- "negative Python int cannot be converted to C
unsigned long long");
- else
- ullong_val = llong_val;
- } else if (PyLong_Check(obj)) {
-#else
if (PyLong_Check(obj)) {
-#endif
ullong_val = PyLong_AsUnsignedLongLong(obj);
} else {
PyErr_SetString(PyExc_TypeError, "an integer is required");
@@ -367,9 +285,7 @@
libvirt_charPtrUnwrap(PyObject *obj,
char **str)
{
-#if PY_MAJOR_VERSION > 2
PyObject *bytes;
-#endif
const char *ret;
*str = NULL;
if (!obj) {
@@ -377,21 +293,15 @@
return -1;
}
-#if PY_MAJOR_VERSION > 2
if (!(bytes = PyUnicode_AsUTF8String(obj)))
return -1;
ret = PyBytes_AsString(bytes);
-#else
- ret = PyString_AsString(obj);
-#endif
if (ret) {
*str = strdup(ret);
if (!*str)
PyErr_NoMemory();
}
-#if PY_MAJOR_VERSION > 2
Py_DECREF(bytes);
-#endif
return ret && *str ? 0 : -1;
}
@@ -400,10 +310,6 @@
char **str,
Py_ssize_t *size)
{
- int ret;
-#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 4
- int isize;
-#endif
*str = NULL;
*size = 0;
if (!obj) {
@@ -411,18 +317,7 @@
return -1;
}
-#if PY_MAJOR_VERSION > 2
- ret = PyBytes_AsStringAndSize(obj, str, size);
-#else
-# if PY_MINOR_VERSION <= 4
- ret = PyString_AsStringAndSize(obj, str, &isize);
- *size = isize;
-# else
- ret = PyString_AsStringAndSize(obj, str, size);
-# endif
-#endif
-
- return ret;
+ return PyBytes_AsStringAndSize(obj, str, size);
}
PyObject *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libvirt-python-5.10.0/typewrappers.h
new/libvirt-python-6.0.0/typewrappers.h
--- old/libvirt-python-5.10.0/typewrappers.h 2019-08-05 19:18:56.000000000
+0200
+++ new/libvirt-python-6.0.0/typewrappers.h 2020-01-15 16:20:01.000000000
+0100
@@ -22,11 +22,6 @@
# define ATTRIBUTE_UNUSED
#endif
-/* Work around really old python. */
-#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5
-typedef ssize_t Py_ssize_t;
-#endif
-
#if !LIBVIR_CHECK_VERSION(4, 5, 0)
typedef struct _virNWFilterBinding *virNWFilterBindingPtr;
#endif
++++++ revert-b22e4f24.patch ++++++
++++ 855 lines (skipped)