hal/hald/linux bus_device.c, 1.14, 1.15 class_device.c, 1.21,
1.22 common.c, 1.10, 1.11 common.h, 1.4, 1.5 osspec.c, 1.27,
1.28 platform_bus_device.c, 1.3, 1.4
Joe Shaw
joe at freedesktop.org
Wed Jul 21 15:32:19 PDT 2004
Update of /cvs/hal/hal/hald/linux
In directory pdx:/tmp/cvs-serv6832/hald/linux
Modified Files:
bus_device.c class_device.c common.c common.h osspec.c
platform_bus_device.c
Log Message:
2004-07-21 Joe Shaw <joeshaw at novell.com>
* hald/linux/bus_device.c (bus_device_move_from_tdl_to_gdl): If
the info.parent property is not set, then set it to the computer
device's UDI.
* hald/linux/class_device.c (class_device_move_from_tdl_to_gdl):
Ditto.
* hald/linux/common.c (device_move_from_tdl_to_gdl): Remove this,
it's dead code.
* hald/linux/osspec.c (osspec_probe): Rename "fakeroot" to "root",
rename its product from "City of Lost Devices" to "Computer",
change its UDI to "computer" from "fakeroot", and make it
non-virtual.
* hald/linux/platform_bus_device.c (platform_device_pre_process):
Change "fakeroot" to "computer".
Index: bus_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/bus_device.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- bus_device.c 18 Jul 2004 15:21:23 -0000 1.14
+++ bus_device.c 21 Jul 2004 22:32:17 -0000 1.15
@@ -146,6 +146,12 @@
{
BusAsyncData *bad = (BusAsyncData*) user_data;
+ if (!hal_device_has_property (device, "info.parent")) {
+ hal_device_property_set_string (
+ device, "info.parent",
+ "/org/freedesktop/Hal/devices/computer");
+ }
+
g_object_ref (device);
hal_device_store_remove (hald_get_tdl (), device);
hal_device_store_add (hald_get_gdl (), device);
Index: class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/class_device.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- class_device.c 20 Jul 2004 17:27:16 -0000 1.21
+++ class_device.c 21 Jul 2004 22:32:17 -0000 1.22
@@ -410,6 +410,12 @@
{
ClassAsyncData *cad = (ClassAsyncData*) user_data;
+ if (!hal_device_has_property (device, "info.parent")) {
+ hal_device_property_set_string (
+ device, "info.parent",
+ "/org/freedesktop/Hal/devices/computer");
+ }
+
g_object_ref (device);
hal_device_store_remove (hald_get_tdl (), device);
hal_device_store_add (hald_get_gdl (), device);
Index: common.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/common.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- common.c 20 Jul 2004 17:27:16 -0000 1.10
+++ common.c 21 Jul 2004 22:32:17 -0000 1.11
@@ -890,25 +890,4 @@
sysfs_close_directory (dir);
}
-/** Removes the device from the TDL and adds it to the GDL when all
- * all of the device's callouts have finished. This is a gobject
- * signal callback.
- *
- * @param device The device being moved
- * @param user_data User data provided when connecting the signal
- *
- */
-void
-device_move_from_tdl_to_gdl (HalDevice *device, gpointer user_data)
-{
- g_object_ref (device);
- hal_device_store_remove (hald_get_tdl (), device);
- hal_device_store_add (hald_get_gdl (), device);
- g_signal_handlers_disconnect_by_func (device,
- device_move_from_tdl_to_gdl,
- user_data);
- g_object_unref (device);
-}
-
-
/** @} */
Index: common.h
===================================================================
RCS file: /cvs/hal/hal/hald/linux/common.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- common.h 24 Jun 2004 21:47:49 -0000 1.4
+++ common.h 21 Jul 2004 22:32:17 -0000 1.5
@@ -100,9 +100,6 @@
extern char sysfs_mount_path[SYSFS_PATH_MAX];
-void device_move_from_tdl_to_gdl (HalDevice *device, gpointer user_data);
-
-
/* @} */
#endif /* COMMON_H */
Index: osspec.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/osspec.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- osspec.c 21 Jul 2004 17:14:54 -0000 1.27
+++ osspec.c 21 Jul 2004 22:32:17 -0000 1.28
@@ -343,26 +343,25 @@
void
osspec_probe ()
{
- HalDevice *fakeroot;
+ HalDevice *root;
int i;
hald_is_initialising = TRUE;
/*
- * Create the "fakeroot" device for all the devices which don't
- * have sysdevices in sysfs.
+ * Create the toplevel "Computer" device, which will contain
+ * system-wide info and also provide a parent device for devices
+ * which don't have sysdevices in sysfs.
*/
- fakeroot = hal_device_new ();
- hal_device_property_set_string (fakeroot, "info.bus", "unknown");
- hal_device_property_set_string (fakeroot,
+ root = hal_device_new ();
+ hal_device_property_set_string (root, "info.bus", "unknown");
+ hal_device_property_set_string (root,
"linux.sysfs_path_device",
"(none)");
- hal_device_property_set_string (fakeroot, "info.product",
- "City of Lost Devices");
- hal_device_property_set_bool (fakeroot, "info.virtual", TRUE);
- hal_device_set_udi (fakeroot, "/org/freedesktop/Hal/devices/fakeroot");
- hal_device_store_add (hald_get_gdl (), fakeroot);
- g_object_unref (fakeroot);
+ hal_device_property_set_string (root, "info.product", "Computer");
+ hal_device_set_udi (root, "/org/freedesktop/Hal/devices/computer");
+ hal_device_store_add (hald_get_gdl (), root);
+ g_object_unref (root);
/** @todo When the kernel has all devices in /sys/devices
* under either /sys/bus or /sys/class then we can
Index: platform_bus_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/platform_bus_device.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- platform_bus_device.c 8 Jul 2004 21:18:08 -0000 1.3
+++ platform_bus_device.c 21 Jul 2004 22:32:17 -0000 1.4
@@ -139,11 +139,11 @@
hal_device_property_set_string (
d, "storage.physical_device",
- "/org/freedesktop/Hal/devices/fakeroot");
+ "/org/freedesktop/Hal/devices/computer");
hal_device_property_set_string (
d, "info.parent",
- "/org/freedesktop/Hal/devices/fakeroot");
+ "/org/freedesktop/Hal/devices/computer");
hal_device_add_capability (d, "block");
hal_device_add_capability (d, "storage");
More information about the hal-commit
mailing list