Bug 1219629

Summary: virt-manager 1.2.0 is unable to list VMs on hosts with old libvirt
Product: Red Hat Enterprise Linux 7 Reporter: Giuseppe Scrivano <gscrivan>
Component: virt-managerAssignee: Giuseppe Scrivano <gscrivan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: berrange, crobinso, gscrivan, info, juzhou, mzhan, rbalakri, thefiguras, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-manager-1.2.0-3-el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1219443 Environment:
Last Closed: 2015-11-19 05:25:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1219443    
Bug Blocks:    

Description Giuseppe Scrivano 2015-05-07 20:10:00 UTC
+++ This bug was initially created as a clone of Bug #1219443 +++

Description of problem:
virt-manager 1.2.0 fails to list VMs when host's libvirt does not support the virConnectListAllDomains() call.

Version-Release number of selected component (if applicable):
1.2.0

How reproducible:
Always

Steps to Reproduce:
1. Use virt-manager 1.2.0 to connect to a host using libvirt version <0.9.13 (e.g. RHEL 5.x).

Actual results:
An error message stating "Error polling connection '<libvirt-URI>': 0" is displayed.

Expected results:
VMs on the selected host should be listed.

Additional info:
I believe this is caused by the changes to virtinst/pollhelpers.py introduced in commit 838baf6 - _new_poll_helper() and _old_poll_helper() are modified, but not _old_fetch_vms(), which is used for hosts with old libvirt versions. Applying the attached patch fixed the problem for me.

--- Additional comment from Cole Robinson on 2015-05-07 11:11:58 EDT ---

Thank you for cleaning up my mistake. I've pushed your patch now:

commit c4d26d16a65e0ce6b88323e13669c7c388397d7f
Author: Michał Kępień <michal.kepien>
Date:   Thu May 7 11:10:20 2015 -0400

    pollhelpers: Fix VM polling on old libvirt
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1219443

Comment 2 Giuseppe Scrivano 2015-05-11 07:22:59 UTC
*** Bug 1220260 has been marked as a duplicate of this bug. ***

Comment 4 fwu 2015-05-27 09:38:38 UTC
I can reproduce this bug with package:
virt-manager-1.2.0-2.el7.noarch

Steps are the same as description above.

Then try to verify with new build:
virt-manager-1.2.0-4.el7.noarch

Steps:
1. Start virt-manager
# virt-manager

2. Click 'File' -> 'Add Connection'

3. On the pop-up window, Choose Xen for Hypervisor -> Click "connect to remote host"--> choose 'SSH' -> Input the hostname (eg:10.66.106.64) ->Click 'Connect'

4. Input the password correctly and establish connection.

Results:
After Step 4, can connect to xen host successfully.
VMs on the selected host are listed.

According to the result above in the latest version of virt-manager, move this bug from ON_QA to VERIFIED.

Comment 5 info 2015-06-01 06:20:41 UTC
Verify that this bug is now also in Fedora 22, when connecting to a KVM host running Debian Wheezy (old stable for one month only).

Error polling connection 'qemu+ssh://root@domain/system': 0

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 343, in _handle_tick_queue
    conn.tick_from_engine(**kwargs)
  File "/usr/share/virt-manager/virtManager/connection.py", line 1266, in tick_from_engine
    raise e  # pylint: disable=raising-bad-type
KeyError: 0


When I install the latest virt-manager from F21, virt-manager works as expected.

Comment 6 info 2015-06-01 06:23:08 UTC
work-around: install

[   ] virt-install-1.1.0-8.git310f6527.fc21.noarch.rpm          21-Apr-2015 05:16   88K
[   ] virt-manager-1.1.0-8.git310f6527.fc21.noarch.rpm          21-Apr-2015 05:16  624K
[   ] virt-manager-common-1.1.0-8.git310f6527.fc21.noarch.rpm   21-Apr-2015 05:16  1.0M

http://ftp.nluug.nl/os/Linux/distr/fedora/linux/updates/21/x86_64/v/

or upgrade kvm host

Comment 8 errata-xmlrpc 2015-11-19 05:25:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2206.html