[Pkg-libvirt-maintainers] Bug#700077: python-libvirt causes 'virGetLastError() not defined' errors in virt-manager

Francois Gouget fgouget at free.fr
Fri Feb 8 10:04:17 UTC 2013


Package: python-libvirt
Version: 1.0.2-1
Severity: important
Tags: patch

Dear Maintainer,

After upgrading to python-libvirt 1.0.2-1 from experimental virt-manager was unable to open my local VMs (it could still open remote VMs strangely enough). The error I got was:

Error launching details: global name 'virGetLastError' is not defined

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 606, in _show_vm_helper
    details.show()
  File "/usr/share/virt-manager/virtManager/details.py", line 564, in show
    self.refresh_vm_state()
  File "/usr/share/virt-manager/virtManager/details.py", line 1405, in refresh_vm_state
    self.change_run_text(vm.hasSavedImage())
  File "/usr/share/virt-manager/virtManager/domain.py", line 1115, in hasSavedImage
    return self._backend.hasManagedSaveImage(0)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 800, in hasManagedSaveImage
    if ret == -1: raise libvirtError ('virDomainHasManagedSaveImage() failed', dom=self)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 35, in __init__
    err = virGetLastError()
NameError: global name 'virGetLastError' is not defined

I traced it back to /usr/lib/python2.7/dist-packages/libvirt.py and the patch below fixes the issue for me:

--- /usr/lib/python2.7/dist-packages/libvirt.py.orig    2013-01-30 22:34:48.000000000 +0100
+++ /usr/lib/python2.7/dist-packages/libvirt.py 2013-02-07 18:19:58.013527296 +0100
@@ -32,7 +32,7 @@
 
         # Never call virConnGetLastError().
         # virGetLastError() is now thread local
-        err = virGetLastError()
+        err = libvirtmod.virGetLastError()
         if err is None:
             msg = defmsg
         else:


Note that it's likely the same patch should be applied to /usr/lib/python2.6/dist-packages/libvirt.py for users on Python 2.6.
Just for reference, I currently have virt-manager 0.9.3-2.

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-libvirt depends on:
ii  libaudit0           1:1.7.18-1.1
ii  libavahi-client3    0.6.31-1
ii  libavahi-common3    0.6.31-1
ii  libc6               2.13-37
ii  libcap-ng0          0.6.6-2
ii  libdbus-1-3         1.6.8-1
ii  libdevmapper1.02.1  2:1.02.74-4
ii  libgcrypt11         1.5.0-3
ii  libgnutls26         2.12.20-4
ii  libnl-3-200         3.2.7-4
ii  libnl-route-3-200   3.2.7-4
ii  libnuma1            2.0.8~rc4-1
ii  libsasl2-2          2.1.25.dfsg1-6
ii  libvirt0            1.0.2-1
ii  libxml2             2.8.0+dfsg1-7
ii  libyajl2            2.0.4-2
ii  python              2.7.3~rc2-1

Versions of packages python-libvirt recommends:
ii  libvirt-bin  1.0.2-1

python-libvirt suggests no packages.

-- no debconf information



More information about the Pkg-libvirt-maintainers mailing list