hal/hald/linux2 blockdev.c,1.38,1.39
David Zeuthen
david at kemper.freedesktop.org
Fri Mar 10 10:46:18 PST 2006
Update of /cvs/hal/hal/hald/linux2
In directory kemper:/tmp/cvs-serv32750/hald/linux2
Modified Files:
blockdev.c
Log Message:
2006-03-10 David Zeuthen <davidz at redhat.com>
Patch from Christian Neumair <chris at gnome-de.org>.
* hald/linux2/blockdev.c (hotplug_event_begin_add_blockdev): Set
FALSE for volume.is_mounted_read_only
* libhal-storage/libhal-storage.c (libhal_drive_from_udi): Extract
volume.is_mounted_read_only
(libhal_volume_is_mounted_read_only): New function
* libhal-storage/libhal-storage.h: Export prototype for
libhal_volume_is_mounted_read_only()
* hald/linux2/blockdev.c (blockdev_refresh_mount_state): Set
volume.is_mounted_read_only
* doc/spec/hal-spec.xml.in: Document volume.is_mounted_read_only
Index: blockdev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/blockdev.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- blockdev.c 24 Feb 2006 04:29:06 -0000 1.38
+++ blockdev.c 10 Mar 2006 18:46:16 -0000 1.39
@@ -228,9 +228,13 @@
/* found entry for this device in /proc/mounts */
device_property_atomic_update_begin ();
hal_device_property_set_bool (dev, "volume.is_mounted", TRUE);
+ hal_device_property_set_bool (dev, "volume.is_mounted_read_only",
+ hasmntopt (&mnt, MNTOPT_RO) ? TRUE : FALSE);
hal_device_property_set_string (dev, "volume.mount_point", mnt.mnt_dir);
device_property_atomic_update_end ();
- HAL_INFO ((" set %s to be mounted at %s", hal_device_get_udi (dev), mnt.mnt_dir));
+ HAL_INFO ((" set %s to be mounted at %s (%s)",
+ hal_device_get_udi (dev), mnt.mnt_dir,
+ hasmntopt (&mnt, MNTOPT_RO) ? "ro" : "rw"));
volumes = g_slist_delete_link (volumes, volume);
break;
}
@@ -247,6 +251,7 @@
mount_point = g_strdup (hal_device_property_get_string (dev, "volume.mount_point"));
device_property_atomic_update_begin ();
hal_device_property_set_bool (dev, "volume.is_mounted", FALSE);
+ hal_device_property_set_bool (dev, "volume.is_mounted_read_only", FALSE);
hal_device_property_set_string (dev, "volume.mount_point", "");
device_property_atomic_update_end ();
HAL_INFO (("set %s to unmounted", hal_device_get_udi (dev)));
@@ -924,6 +929,7 @@
hal_device_property_set_string (d, "volume.label", "");
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.is_disc",
strcmp (hal_device_property_get_string (parent, "storage.drive_type"), "cdrom") == 0);
More information about the hal-commit
mailing list