Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 451666 - 0.4.3 in updates-testing doesn't seem to work with ruby-libvirt bindings
Summary: 0.4.3 in updates-testing doesn't seem to work with ruby-libvirt bindings
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: ruby-libvirt
Version: 9
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: David Lutterkort
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-16 15:34 UTC by Chris Lalancette
Modified: 2013-04-30 23:40 UTC (History)
4 users (show)

Fixed In Version: 0.4.4-1.fc9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-07-01 05:30:20 UTC


Attachments (Terms of Use)
Output from the ruby program with LIBVIRT_DEBUG=1 set (deleted)
2008-06-17 08:33 UTC, Chris Lalancette
no flags Details

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 Berrange 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 Berrange 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.


Note You need to log in before you can comment on or make changes to this bug.