hal: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Thu Aug 3 09:14:35 PDT 2006


 doc/spec/hal-spec-properties.xml |   10 ++++++++++
 hald/linux2/blockdev.c           |    5 ++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

New commits:
diff-tree dd861aad6a6f67ae1195c149569fe0b01cc00e12 (from 27f93b3320768981b01c155bd3dba18137e6c43e)
Author: David Zeuthen <davidz at redhat.com>
Date:   Thu Aug 3 12:14:25 2006 -0400

    fix device mapper block device handling as last commit broke this
    
    Introduce new property volume.linux.is_device_mapper and check for this
    on remove events to avoid looping in hotplug remove.

diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index f13b72c..c0791cd 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -2326,6 +2326,16 @@
             </row>
             <row>
               <entry>
+                <literal>volume.linux.is_device_mapper</literal> (bool)
+              </entry>
+              <entry></entry>
+              <entry>Yes, but only on Linux</entry>
+              <entry>
+                If the volume stems from the Linux Device Mapper this property is set to <literal>TRUE</literal>.
+              </entry>
+            </row>
+            <row>
+              <entry>
                 <literal>volume.partition.number</literal> (int)
               </entry>
               <entry></entry>
diff --git a/hald/linux2/blockdev.c b/hald/linux2/blockdev.c
index 5c06e9e..bf0b014 100644
--- a/hald/linux2/blockdev.c
+++ b/hald/linux2/blockdev.c
@@ -1173,6 +1173,7 @@ hotplug_event_begin_add_blockdev (const 
 		hal_device_property_set_string (d, "volume.mount_point", "");
 		hal_device_property_set_bool (d, "volume.is_mounted", FALSE);
 		hal_device_property_set_bool (d, "volume.is_mounted_read_only", FALSE);
+		hal_device_property_set_bool (d, "volume.linux.is_device_mapper", is_device_mapper);
 		hal_device_property_set_bool (
 			d, "volume.is_disc", 
 			strcmp (hal_device_property_get_string (parent, "storage.drive_type"), "cdrom") == 0);
@@ -1353,8 +1354,10 @@ hotplug_event_begin_remove_blockdev (con
 		const char *stor_udi;
 		HalDevice *stor_dev;
 		gboolean is_fakevolume;
+		gboolean is_device_mapper;
 
 		is_partition = hal_device_property_get_bool (d, "volume.is_partition");
+		is_device_mapper = hal_device_property_get_bool (d, "volume.linux.is_device_mapper");
 
 		if (strcmp (hal_util_get_last_element (sysfs_path), "fakevolume") == 0)
 			is_fakevolume = TRUE;
@@ -1385,7 +1388,7 @@ hotplug_event_begin_remove_blockdev (con
 					goto out;
 				}
 			}
-		} else if (!is_partition) {
+		} else if ((!is_partition) && (!is_device_mapper)) {
 			GSList *i;
 			GSList *partitions;
 			unsigned int num_childs;



More information about the hal-commit mailing list