Bug 451666

Summary: 0.4.3 in updates-testing doesn't seem to work with ruby-libvirt bindings
Product: [Fedora] Fedora Reporter: Chris Lalancette <clalance>
Component: ruby-libvirtAssignee: David Lutterkort <lutter>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: apevec, berrange, hbrock, mastahnke
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.4.4-1.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-01 05:30:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output from the ruby program with LIBVIRT_DEBUG=1 set none

Description Chris Lalancette 2008-06-16 15:34:06 UTC
Description of problem:
I started testing libvirt-0.4.3 in an oVirt context, and have run into some
problems with it.  Specifically, oVirt uses the ruby-libvirt bindings to talk to
the libvirt APIs and make calls to libvirtd running on remote machines.  The
ruby code really just does this:

  all_pools = []
  all_pools.concat(conn.list_defined_storage_pools)
  all_pools.concat(conn.list_storage_pools)

And I'm getting:

libvir: error : invalid argument in virConnectListDefinedStoragePools
refresh_pool
Task action processing failed: Libvirt::RetrieveError: Call to function
virConnectListDefinedStoragePools failed
/usr/share/ovirt-wui/task-omatic/./utils.rb:14:in `list_defined_storage_pools'
/usr/share/ovirt-wui/task-omatic/./utils.rb:14:in `all_storage_pools'
/usr/share/ovirt-wui/task-omatic/./task_storage.rb:73:in `refresh_pool'
/usr/share/ovirt-wui/task-omatic/taskomatic.rb:106
/usr/share/ovirt-wui/task-omatic/taskomatic.rb:88:in `each'
/usr/share/ovirt-wui/task-omatic/taskomatic.rb:88
/usr/share/ovirt-wui/task-omatic/taskomatic.rb:67:in `loop'
/usr/share/ovirt-wui/task-omatic/taskomatic.rb:67

This same code works in 0.4.2, so something has changed with the way these
things are interacting.

Comment 1 Daniel Berrangé 2008-06-16 15:43:58 UTC
Please re-run with  LIBVIRT_DEBUG=1 environment variable set so that it includes
debug output. This should tell us where the invalid argument is coming from.

Comment 2 Chris Lalancette 2008-06-17 08:33:02 UTC
Created attachment 309582 [details]
Output from the ruby program with LIBVIRT_DEBUG=1 set

I'm attaching the entire output of the program with LIBVIRT_DEBUG=1 set, but I
believe the relevant part is:

DEBUG: libvirt.c: virConnectListDefinedStoragePools (conn=0xccf1d0,
names=0xc26dd0, maxnames=0)
libvir: error : invalid argument in virConnectListDefinedStoragePools
./storage.rb:25:in `list_defined_storage_pools': Call to function
virConnectListDefinedStoragePools failed (Libvirt::RetrieveError)
	from ./storage.rb:25:in `create_pool'
	from ./storage.rb:54
DEBUG: libvirt.c: virConnectClose (conn=0xccf1d0)

Comment 3 Daniel Berrangé 2008-06-17 08:46:51 UTC
DEBUG: libvirt.c: virConnectListDefinedStoragePools (conn=0xccf1d0,
names=0xc26dd0, maxnames=0)


This shows the problem. The ruby bindings should not be using a maxnames value
of 0.  

Comment 4 Chris Lalancette 2008-06-17 09:17:15 UTC
FYI: I posted a patch for this issue to the libvirt mailing list today.

Chris Lalancette

Comment 5 Daniel Veillard 2008-06-17 09:26:00 UTC
Path for the patch in the archive:

https://www.redhat.com/archives/libvir-list/2008-June/msg00175.html

Daniel

Comment 6 Daniel Veillard 2008-06-17 10:06:44 UTC
IMHO the underlying driver which failed need to be fixed as 0 is an accepted
value. Once done applying the patch on the binding to shortcut the function
call may be okay as a local optimization (but you loose the argument checkings).

Daniel

Comment 7 Chris Lalancette 2008-06-19 08:58:28 UTC
OK.  I actually figured out what was really going on here, and I've posted a
patch to fix the underlying libvirt problems as well:

https://www.redhat.com/archives/libvir-list/2008-June/msg00209.html

That being said, I think the patch for the ruby bindings is a good optimization,
so I think both patches are useful.

Chris Lalancette

Comment 8 David Lutterkort 2008-06-20 20:06:51 UTC
I agree, the patch for ruby-libvirt looks good and I'll commit it shortly.

Comment 9 David Lutterkort 2008-06-20 20:10:07 UTC
I committed the patch with a couple more places to shortcircuit added. Making a
release and pushing an update will likely have to wait till next week.

Comment 10 Chris Lalancette 2008-06-21 08:30:54 UTC
Cool, thanks David!

Chris Lalancette

Comment 11 Fedora Update System 2008-06-25 09:27:19 UTC
libvirt-0.4.4-1.fc9 has been submitted as an update for Fedora 9

Comment 12 Fedora Update System 2008-06-26 08:29:28 UTC
libvirt-0.4.4-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update libvirt'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-5736

Comment 13 Fedora Update System 2008-07-01 05:30:13 UTC
libvirt-0.4.4-1.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.