[libvirt] PATCH: Fix node device APIs for RHEL-5 vintage HAL

In the node device APIs we look for a property in HAL call info.subsystem. Turns out this is a fairly recent addition to HAL, and it used to be called 'linux.subsystem' in RHEL-5 vintage & earlier. This means we never see any PCI / USB devices in libvirt when on RHEL-5. This patch makes us check for both those properties, since the values are the same for each - just the property name changed Daniel Index: src/node_device_hal.c =================================================================== RCS file: /data/cvs/libvirt/src/node_device_hal.c,v retrieving revision 1.9 diff -u -p -r1.9 node_device_hal.c --- src/node_device_hal.c 2 Mar 2009 17:41:13 -0000 1.9 +++ src/node_device_hal.c 12 Mar 2009 14:07:12 -0000 @@ -357,7 +357,8 @@ static int gather_capabilities(LibHalCon goto failure; } - if (get_str_prop(ctx, udi, "info.subsystem", &bus_name) == 0) { + if (get_str_prop(ctx, udi, "info.subsystem", &bus_name) == 0 || + get_str_prop(ctx, udi, "linux.subsystem", &bus_name) == 0) { rv = gather_capability(ctx, udi, bus_name, &caps); if (rv != 0) goto failure; -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Thu, Mar 12, 2009 at 02:09:10PM +0000, Daniel P. Berrange wrote:
In the node device APIs we look for a property in HAL call info.subsystem. Turns out this is a fairly recent addition to HAL, and it used to be called 'linux.subsystem' in RHEL-5 vintage & earlier. This means we never see any PCI / USB devices in libvirt when on RHEL-5.
This patch makes us check for both those properties, since the values are the same for each - just the property name changed
Okay, since this may affect old hals in general and not just RHEL patch looks just firn to me, ACK, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (2)
-
Daniel P. Berrange
-
Daniel Veillard