[Pkg-libvirt-commits] [SCM] Libvirt Debian packaging branch, master, updated. debian/1.0.2-2

Guido Günther agx at sigxcpu.org
Fri Feb 8 13:49:34 UTC 2013


The following commit has been merged in the master branch:
commit 7e3ee2feecd8a1c443e9075854fbee82c06a4cb5
Author: Guido Günther <agx at sigxcpu.org>
Date:   Fri Feb 8 14:03:28 2013 +0100

    Cherry-pick upstream fixes for Python bindings
    
    Closes: #700077

diff --git a/debian/patches/series b/debian/patches/series
index 6148614..1b6895d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,5 @@ Don-t-fail-if-we-can-t-setup-avahi.patch
 Reduce-udevadm-settle-timeout-to-10-seconds.patch
 debian/Debianize-systemd-service-files.patch
 Allow-xen-toolstack-to-find-it-s-binaries.patch
+upstream/Fix-missing-error-constants-in-libvirt-python-module.patch
+upstream/complete-virterror-virerror-name-change.patch
diff --git a/debian/patches/upstream/Fix-missing-error-constants-in-libvirt-python-module.patch b/debian/patches/upstream/Fix-missing-error-constants-in-libvirt-python-module.patch
new file mode 100644
index 0000000..cd95d94
--- /dev/null
+++ b/debian/patches/upstream/Fix-missing-error-constants-in-libvirt-python-module.patch
@@ -0,0 +1,91 @@
+From: "Daniel P. Berrange" <berrange at redhat.com>
+Date: Tue, 5 Feb 2013 12:55:09 +0000
+Subject: Fix missing error constants in libvirt python module
+
+The previous change to the generator, changed too much - only
+the functions are in 'virerror.c', the constants remained in
+'virerror.h' which could not be renamed for API compat reasons.
+
+Add a test case to sanity check the generated python bindings
+
+Closes: #700077
+---
+ python/Makefile.am   |    5 +++++
+ python/generator.py  |    2 ++
+ python/sanitytest.py |   31 +++++++++++++++++++++++++++++++
+ 3 files changed, 38 insertions(+)
+ create mode 100644 python/sanitytest.py
+
+diff --git a/python/Makefile.am b/python/Makefile.am
+index dd69600..ef3c3eb 100644
+--- a/python/Makefile.am
++++ b/python/Makefile.am
+@@ -119,6 +119,11 @@ $(libvirtmod_la_OBJECTS): $(GENERATED)
+ $(libvirtmod_qemu_la_OBJECTS): $(QEMU_GENERATED)
+ $(libvirtmod_lxc_la_OBJECTS): $(LXC_GENERATED)
+ 
++EXTRA_DIST += sanitytest.py
++
++check-local:
++	$(AM_V_GEN)PYTHONPATH=$(abs_topbuilddir):$(abs_topbuilddir)/.libs $(PYTHON) $(srcdir)/sanitytest.py
++
+ install-data-local:
+ 	$(mkinstalldirs) $(DESTDIR)$(pyexecdir)
+ 	$(INSTALL) -m 0644 libvirt.py $(DESTDIR)$(pyexecdir)
+diff --git a/python/generator.py b/python/generator.py
+index 5d27f66..9297a15 100755
+--- a/python/generator.py
++++ b/python/generator.py
+@@ -122,6 +122,7 @@ class docParser(xml.sax.handler.ContentHandler):
+                 if attrs.has_key('field'):
+                     self.function_return_field = attrs['field']
+         elif tag == 'enum':
++            # enums come from header files, hence virterror.h
+             if (attrs['file'] == "libvirt" or
+                 attrs['file'] == "virterror"):
+                 enum(attrs['type'],attrs['name'],attrs['value'])
+@@ -134,6 +135,7 @@ class docParser(xml.sax.handler.ContentHandler):
+         if debug:
+             print "end %s" % tag
+         if tag == 'function':
++            # fuctions come from source files, hence 'virerror.c'
+             if self.function != None:
+                 if (self.function_module == "libvirt" or
+                     self.function_module == "virevent" or
+diff --git a/python/sanitytest.py b/python/sanitytest.py
+new file mode 100644
+index 0000000..047450b
+--- /dev/null
++++ b/python/sanitytest.py
+@@ -0,0 +1,31 @@
++#!/usr/bin/python
++
++import libvirt
++
++globals = dir(libvirt)
++
++# Sanity test that the generator hasn't gone wrong
++
++# Look for core classes
++assert("virConnect" in globals)
++assert("virDomain" in globals)
++assert("virDomainSnapshot" in globals)
++assert("virInterface" in globals)
++assert("virNWFilter" in globals)
++assert("virNodeDevice" in globals)
++assert("virNetwork" in globals)
++assert("virSecret" in globals)
++assert("virStoragePool" in globals)
++assert("virStorageVol" in globals)
++assert("virStream" in globals)
++assert("VIR_CONNECT_RO" in globals)
++
++# Error related bits
++assert("libvirtError" in globals)
++assert("VIR_ERR_AUTH_FAILED" in globals)
++assert("virGetLastError" in globals)
++
++# Some misc methods
++assert("virInitialize" in globals)
++assert("virEventAddHandle" in globals)
++assert("virEventRegisterDefaultImpl" in globals)
diff --git a/debian/patches/upstream/complete-virterror-virerror-name-change.patch b/debian/patches/upstream/complete-virterror-virerror-name-change.patch
new file mode 100644
index 0000000..ce05fad
--- /dev/null
+++ b/debian/patches/upstream/complete-virterror-virerror-name-change.patch
@@ -0,0 +1,36 @@
+From: Serge Hallyn <serge.hallyn at canonical.com>
+Date: Wed, 30 Jan 2013 21:05:45 -0600
+Subject: complete virterror->virerror name change
+
+Without these two string changes in generator.py, the
+virGetLastError wrapper does not get created in
+/usr/share/pyshared/libvirt.py.  Noticed when running
+tests with virt-install.
+
+Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
+---
+ python/generator.py |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/python/generator.py b/python/generator.py
+index 9297a15..4e4642f 100755
+--- a/python/generator.py
++++ b/python/generator.py
+@@ -124,7 +124,7 @@ class docParser(xml.sax.handler.ContentHandler):
+         elif tag == 'enum':
+             # enums come from header files, hence virterror.h
+             if (attrs['file'] == "libvirt" or
+-                attrs['file'] == "virterror"):
++                attrs['file'] == "virerror"):
+                 enum(attrs['type'],attrs['name'],attrs['value'])
+             elif attrs['file'] == "libvirt-lxc":
+                 lxc_enum(attrs['type'],attrs['name'],attrs['value'])
+@@ -139,7 +139,7 @@ class docParser(xml.sax.handler.ContentHandler):
+             if self.function != None:
+                 if (self.function_module == "libvirt" or
+                     self.function_module == "virevent" or
+-                    self.function_module == "virterror"):
++                    self.function_module == "virerror"):
+                     function(self.function, self.function_descr,
+                              self.function_return, self.function_args,
+                              self.function_file, self.function_module,

-- 
Libvirt Debian packaging



More information about the Pkg-libvirt-commits mailing list