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

Re: [Xen-devel] [PATCH 0/2] Fix python bindings for libxenstat



Hi Wei,

On 06/13/2017 12:00 PM, Wei Liu wrote:
On Tue, Jun 13, 2017 at 01:05:19AM +0200, Peter Große wrote:
Hello.

I tried to build and use the python bindings for libxenstat.

Building worked, after I changed the hardcoded PYTHON_VERSION variable in the
tools/xenstat/libxenstat/Makefile. Maybe the version detected by configure
can be used here. The 1st patch tries to address this.

Then, when I tried to import the python module, the following error occurred:

Python 2.7.12 (default, Mar 31 2017, 19:45:03)
[GCC 4.9.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import xenstat
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "xenstat.py", line 17, in <module>
     _xenstat = swig_import_helper()
   File "xenstat.py", line 16, in swig_import_helper
     return importlib.import_module('_xenstat')
   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
     __import__(name)
ImportError: /usr/lib64/libxenstat.so.0: undefined symbol: yajl_tree_parse


After some digging in the Makefiles I found, that the only current user of 
libxenstat,
xentop, is linked against libyajl, but doesn't call any of the functions 
provided by the lib
directly. OTOH libxenstat uses libyajl in xenstat_qmp.c, but isn't linked 
against it.

So my idea to fix the error above was to move the -lyajl from the xentop build 
to the
libxenstat build, as seen in the 2nd patch.

With that patch, the bindings work without problems.
But I'm not sure if my ideas are correct.

Regards
Peter

Peter Große (2):
   libxenstat: use python detected by configure for python bindings
   tools/xenstat: fix missing linkage of libxenstat against libyajl

  tools/xenstat/libxenstat/Makefile | 4 ++--
  tools/xenstat/xentop/Makefile     | 2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)


Both patches:

Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>

Julien, I think they could be included for 4.9.

Release-acked-by: Julien Grall <julien.grall@xxxxxxx>

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.