hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Thu Mar 6 06:26:47 PST 2008


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

New commits:
commit 5327ca17b1642911f2854c2e86f491b132c457ae
Author: Olaf Hering <olh at suse.de>
Date:   Thu Mar 6 15:26:34 2008 +0100

    added vio storage bus support
    
    Added vio storage bus support. Set storage.bus and storage.drive_type
    for vio storage devices.

diff --git a/hald/linux/blockdev.c b/hald/linux/blockdev.c
index e75635d..8a4befa 100644
--- a/hald/linux/blockdev.c
+++ b/hald/linux/blockdev.c
@@ -1176,6 +1176,10 @@ hotplug_event_begin_add_blockdev (const gchar *sysfs_path, const gchar *device_f
 					is_hotpluggable = TRUE;
 					hal_device_property_set_string
 						(d, "storage.bus", "ccw");
+				} else if (strcmp (bus, "vio") == 0) {
+					physdev = d_it;
+					physdev_udi = udi_it;
+					hal_device_property_set_string (d, "storage.bus", "vio");
 				}
 			}
 
@@ -1310,6 +1314,24 @@ hotplug_event_begin_add_blockdev (const gchar *sysfs_path, const gchar *device_f
 
 		} else if (strcmp (parent_bus, "mmc") == 0) {
 			hal_device_property_set_string (d, "storage.drive_type", "sd_mmc");
+		} else if (strcmp (parent_bus, "vio") == 0) {
+			char buf[256];
+			const gchar *prop;
+
+			snprintf(buf, sizeof(buf), "%s/device", sysfs_path_real);
+			prop = hal_util_get_string_from_file (buf, "name");
+			if (prop) {
+				if (strcmp (prop, "viocd") == 0) {
+					hal_device_property_set_string (d, "info.product", "Vio Virtual CD");
+					hal_device_property_set_string (d, "storage.drive_type", "cdrom");
+				} else if (strcmp (prop, "viodasd") == 0) {
+					hal_device_property_set_string (d, "info.product", "Vio Virtual Disk");
+					hal_device_property_set_string (d, "storage.drive_type", "disk");
+				} else if (strcmp (prop, "viotape") == 0) {
+					hal_device_property_set_string (d, "info.product", "Vio Virtual Tape");
+					hal_device_property_set_string (d, "storage.drive_type", "tape");
+				}
+			}
 		}
 
 		hal_device_property_set_string (d, "info.category", "storage");


More information about the hal-commit mailing list