hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Thu Mar 6 06:57:38 PST 2008


 hald/linux/blockdev.c |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 7f9c5ead27bc7b2bf2155f85374fdb4e35b606aa
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Thu Mar 6 15:54:38 2008 +0100

    generate better udis for virtual storage devices
    
    Generate better UDIs for virtual storage devices (like vio bus devices).

diff --git a/hald/linux/blockdev.c b/hald/linux/blockdev.c
index 846e7a9..47c95c5 100644
--- a/hald/linux/blockdev.c
+++ b/hald/linux/blockdev.c
@@ -99,9 +99,13 @@ blockdev_compute_udi (HalDevice *d)
 	} else {
 		const char *model;
 		const char *serial;
+		const char *bus;
+		const char *type;
 
 		model = hal_device_property_get_string (d, "storage.model");
 		serial = hal_device_property_get_string (d, "storage.serial");
+		bus = hal_device_property_get_string (d, "storage.bus");
+		type = hal_device_property_get_string (d, "storage.drive_type");
 
 		if (serial != NULL) {
 			hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
@@ -111,6 +115,11 @@ blockdev_compute_udi (HalDevice *d)
 			hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
 					      "/org/freedesktop/Hal/devices/storage_model_%s", 
 					      model);
+		} else if ((bus != NULL) && (type != NULL)){
+			hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
+					      "%s_storage_%s_%s", 
+					      hal_device_property_get_string (d, "storage.originating_device"),
+					      bus, type);
 		} else {
 			hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
 					      "%s_storage", 


More information about the hal-commit mailing list