hal/libhal-storage libhal-storage.c, 1.4, 1.5 libhal-storage.h, 1.3,
1.4
David Zeuthen
david at freedesktop.org
Mon Sep 27 09:37:49 PDT 2004
Update of /cvs/hal/hal/libhal-storage
In directory gabe:/tmp/cvs-serv30713/libhal-storage
Modified Files:
libhal-storage.c libhal-storage.h
Log Message:
2004-09-27 David Zeuthen <david at fubar.dk>
* libhal/libhal.c (hal_shutdown): Remember to init error var
* tools/fstab-sync.c (add_udi): Add a whitelist so if a volume stems
from a msdos style partition table we require that type to be in the
whitelist; initially includes various FAT formats, NTFS and Linux.
(volume_new): Fix a bug in size computation
* libhal-storage/libhal-storage.h: Add prototype for
hal_volume_get_msdos_part_table_type
* libhal-storage/libhal-storage.c:
(hal_volume_get_msdos_part_table_type): New function
* hald/linux/block_class_device.c (block_class_pre_process):
Rename x86_type to msdos_part_table_type
* hald/haldaemon.in: Fixup URL
Index: libhal-storage.c
===================================================================
RCS file: /cvs/hal/hal/libhal-storage/libhal-storage.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- libhal-storage.c 24 Sep 2004 22:27:20 -0000 1.4
+++ libhal-storage.c 27 Sep 2004 16:37:47 -0000 1.5
@@ -665,6 +665,8 @@
dbus_bool_t is_partition;
unsigned int partition_number;
+
+ int msdos_part_table_type;
dbus_bool_t is_disc;
@@ -796,6 +798,7 @@
HAL_PROP_EXTRACT_STRING ("storage.model", drive->model);
HAL_PROP_EXTRACT_STRING ("storage.drive_type", drive->type_textual);
+
HAL_PROP_EXTRACT_STRING ("storage.icon.drive", drive->dedicated_icon_drive);
HAL_PROP_EXTRACT_STRING ("storage.icon.volume", drive->dedicated_icon_volume);
@@ -944,6 +947,8 @@
HAL_PROP_EXTRACT_BEGIN;
+ HAL_PROP_EXTRACT_INT ("volume.partition.msdos_part_table_type", vol->msdos_part_table_type);
+
HAL_PROP_EXTRACT_INT ("block.minor", vol->device_minor);
HAL_PROP_EXTRACT_INT ("block.major", vol->device_major);
HAL_PROP_EXTRACT_STRING ("block.device", vol->device_file);
@@ -1000,6 +1005,21 @@
return NULL;
}
+
+/** If the volume is on a drive with a MSDOS style partition table, return
+ * the partition table id.
+ *
+ * @param volume Volume object
+ * @return The partition type or -1 if volume is not
+ * a partition or the media the volume stems from
+ * isn't partition with a MS DOS style table
+ */
+int
+hal_volume_get_msdos_part_table_type (HalVolume *volume)
+{
+ return volume->msdos_part_table_type;
+}
+
/***********************************************************************/
/** Get the drive object that either is (when given e.g. /dev/sdb) or contains
Index: libhal-storage.h
===================================================================
RCS file: /cvs/hal/hal/libhal-storage/libhal-storage.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- libhal-storage.h 24 Sep 2004 22:27:20 -0000 1.3
+++ libhal-storage.h 27 Sep 2004 16:37:47 -0000 1.4
@@ -240,6 +240,7 @@
dbus_bool_t hal_volume_disc_is_rewritable (HalVolume *volume);
dbus_bool_t hal_volume_disc_is_appendable (HalVolume *volume);
HalVolumeDiscType hal_volume_get_disc_type (HalVolume *volume);
+int hal_volume_get_msdos_part_table_type (HalVolume *volume);
char *hal_volume_policy_compute_size_as_string (HalVolume *volume);
More information about the hal-commit
mailing list