hal/libhal-storage libhal-storage.c, 1.30, 1.31 libhal-storage.h, 1.15, 1.16

David Zeuthen david at kemper.freedesktop.org
Tue Feb 21 22:35:11 PST 2006


Update of /cvs/hal/hal/libhal-storage
In directory kemper:/tmp/cvs-serv20480/libhal-storage

Modified Files:
	libhal-storage.c libhal-storage.h 
Log Message:
2006-02-22  David Zeuthen  <davidz at redhat.com>

        * libhal-storage/libhal-storage.h: Export prototypes for
        libhal_volume_crypto_get_clear_volume_udi and
        libhal_volume_crypto_get_backing_volume_udi

        * libhal-storage/libhal-storage.c:
        (libhal_volume_crypto_get_clear_volume_udi): New function
        (libhal_volume_crypto_get_backing_volume_udi): New function

        * ChangeLog: fix my commit entry for 2006-02-19 - missed changes to
        hald/hald_runner.c



Index: libhal-storage.c
===================================================================
RCS file: /cvs/hal/hal/libhal-storage/libhal-storage.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- libhal-storage.c	18 Feb 2006 22:30:58 -0000	1.30
+++ libhal-storage.c	22 Feb 2006 06:35:09 -0000	1.31
@@ -716,6 +716,7 @@
 
 	dbus_bool_t ignore_volume;
 
+	char *crypto_backing_volume;
 
 	char mount_options[MOUNT_OPTIONS_SIZE];
 };
@@ -777,6 +778,7 @@
 	libhal_free_string (vol->uuid);
 	libhal_free_string (vol->desired_mount_point);
 	libhal_free_string (vol->mount_filesystem);
+	libhal_free_string (vol->crypto_backing_volume);
 
 	free (vol);
 }
@@ -1054,6 +1056,8 @@
 
 		LIBHAL_PROP_EXTRACT_STRING ("block.storage_device",      vol->storage_device);
 
+		LIBHAL_PROP_EXTRACT_STRING ("volume.crypto_luks.clear.backing_volume", vol->crypto_backing_volume);
+
 		LIBHAL_PROP_EXTRACT_INT    ("volume.block_size",         vol->block_size);
 		LIBHAL_PROP_EXTRACT_INT    ("volume.num_blocks",         vol->num_blocks);
 		LIBHAL_PROP_EXTRACT_STRING ("volume.label",              vol->volume_label);
@@ -1516,6 +1520,42 @@
 	return result;
 }
 
+const char *
+libhal_volume_crypto_get_backing_volume_udi (LibHalVolume *volume)
+{
+	return volume->crypto_backing_volume;
+}
+
+char *
+libhal_volume_crypto_get_clear_volume_udi (LibHalContext *hal_ctx, LibHalVolume *volume)
+{
+	DBusError error;
+	char **clear_devices;
+	int num_clear_devices;
+	char *result;
+
+	result = NULL;
+
+	LIBHAL_CHECK_LIBHALCONTEXT (hal_ctx, NULL);
+
+	dbus_error_init (&error);
+	clear_devices = libhal_manager_find_device_string_match (hal_ctx,
+								 "volume.crypto_luks.clear.backing_volume",
+								 volume->udi,
+								 &num_clear_devices,
+								 &error);
+	if (clear_devices != NULL) {
+
+		if (num_clear_devices >= 1) {
+			result = strdup (clear_devices[0]);
+		}
+		libhal_free_string_array (clear_devices);
+	}
+
+	return result;
+}
+
+
 /*************************************************************************/
 
 char *

Index: libhal-storage.h
===================================================================
RCS file: /cvs/hal/hal/libhal-storage/libhal-storage.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- libhal-storage.h	15 Jan 2006 16:54:05 -0000	1.15
+++ libhal-storage.h	22 Feb 2006 06:35:09 -0000	1.16
@@ -279,6 +279,10 @@
 const char          *libhal_volume_get_uuid                      (LibHalVolume     *volume);
 const char          *libhal_volume_get_storage_device_udi        (LibHalVolume     *volume);
 
+const char          *libhal_volume_crypto_get_backing_volume_udi (LibHalVolume     *volume);
+char                *libhal_volume_crypto_get_clear_volume_udi   (LibHalContext    *hal_ctx, LibHalVolume *volume);
+
+
 dbus_bool_t          libhal_volume_disc_has_audio             (LibHalVolume     *volume);
 dbus_bool_t          libhal_volume_disc_has_data              (LibHalVolume     *volume);
 dbus_bool_t          libhal_volume_disc_is_blank              (LibHalVolume     *volume);




More information about the hal-commit mailing list