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.
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.
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)
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.
FYI: I posted a patch for this issue to the libvirt mailing list today. Chris Lalancette
Path for the patch in the archive: https://www.redhat.com/archives/libvir-list/2008-June/msg00175.html Daniel
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
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
I agree, the patch for ruby-libvirt looks good and I'll commit it shortly.
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.
Cool, thanks David! Chris Lalancette
libvirt-0.4.4-1.fc9 has been submitted as an update for Fedora 9
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
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.