hal/hald/linux block_class_device.c, 1.56, 1.57 bus_device.c, 1.17,
1.18 class_device.c, 1.25, 1.26 common.h, 1.7, 1.8 osspec.c,
1.31, 1.32
David Zeuthen
david at freedesktop.org
Sun Aug 22 12:27:24 PDT 2004
Update of /cvs/hal/hal/hald/linux
In directory gabe:/tmp/cvs-serv2401/hald/linux
Modified Files:
block_class_device.c bus_device.c class_device.c common.h
osspec.c
Log Message:
2004-08-22 David Zeuthen <david at fubar.dk>
* hald/callout.c: Only invoke callouts if they have the .hal extension.
Export HALD_VERBOSE if the hald instance is started with verbose.
Add HALD_STARTUP resp. HALD_SHUTDOWN only if the callout is in response
to hald starting up/shutting down.
* hald/hald.c: Add an verbose option. Use the HALD_VERBOSE environment
variable. Postpone daemonization until we are done probing.
* hald/hald.h: Move hald_is_[verbose|initialising|is_shutting_down] here
* hald/linux/bus_device.c:
(bus_device_visit): We can now always assume we got a parent
* hald/linux/class_device.c:
(class_device_visit): We can now always assume we got a parent
* hald/linux/common.h:
* hald/linux/drive_id/drive_id.c:
* hald/linux/osspec.c: Complete rewrite of probing code; now we
construct a list of ''coldplug events'' and feed them to the
two new functions add_device() and rem_device(); this unifies
a few codepaths and it's much faster, cleaner and just yummier.
Also ensure that callouts are run sequentially.
* hald/logger.c:
(logger_enable),
(logger_disable): New functions
(logger_emit): Print time and don't print function name
* hald/logger.h: Add logger_[enable|disable].
* tools/fstab-sync.c:
(open_temp_fstab_file): Use /tmp for the temporary file
(fs_table_has_volume): Remove debug spew
(add_udi): Log a message to the syslog on success
(remove_udi): Log a message to the syslog on success
(clean): Log a message to the syslog on success
(main): Use HALD_VERBOSE. When invoked for the ''computer'' device
object on hald startup, automatically clean the fstab (but only if
using a managed keyword). Don't remove entries on hald
shutdown. In line with the osspec.c changes (sequential callouts)
we now get a fully sanitized /etc/fstab at hald startup, Yay!
* tools/linux/hal_dev.c: (main): Less syslog spamming
* tools/linux/hal_hotplug.c:
(wait_for_sysfs_info): Less syslog spamming
(main): Less syslog spamming
Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- block_class_device.c 19 Aug 2004 17:58:15 -0000 1.56
+++ block_class_device.c 22 Aug 2004 19:27:22 -0000 1.57
@@ -56,6 +56,7 @@
#include "../device_store.h"
#include "../callout.h"
#include "../hald_conf.h"
+#include "../osspec.h"
#include "class_device.h"
#include "common.h"
@@ -74,7 +75,9 @@
static char *block_class_compute_udi (HalDevice * d, int append_num);
+#if 0
static gboolean deferred_check_for_non_partition_media (gpointer data);
+#endif
static void
@@ -1557,6 +1560,7 @@
}
}
+#if 0
static gboolean
deferred_check_for_non_partition_media (gpointer data)
{
@@ -1590,7 +1594,7 @@
g_free (stordev_udi);
return FALSE;
}
-
+#endif
static char *
block_class_compute_udi (HalDevice * d, int append_num)
Index: bus_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/bus_device.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- bus_device.c 16 Aug 2004 18:52:39 -0000 1.17
+++ bus_device.c 22 Aug 2004 19:27:22 -0000 1.18
@@ -129,7 +129,7 @@
"linux.sysfs_path_device",
parent_sysfs_path,
bus_device_got_parent, bad,
- HAL_LINUX_HOTPLUG_TIMEOUT);
+ 0/*HAL_LINUX_HOTPLUG_TIMEOUT*/);
}
/* Now that a) hotplug happens in the right order; and b) the device
@@ -138,6 +138,8 @@
* synchronous so we can test immediately whether we want to
* proceed
*/
+
+ /*
if (hal_device_store_match_key_value_string (
hald_get_gdl (),
"linux.sysfs_path_device",
@@ -149,6 +151,10 @@
free (parent_sysfs_path);
return d;
}
+ */
+
+ free (parent_sysfs_path);
+ return d;
}
Index: class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/class_device.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- class_device.c 16 Aug 2004 18:52:39 -0000 1.25
+++ class_device.c 22 Aug 2004 19:27:22 -0000 1.26
@@ -41,6 +41,7 @@
#include "../logger.h"
#include "../device_store.h"
#include "../hald.h"
+#include "../osspec.h"
#include "common.h"
#include "class_device.h"
@@ -225,6 +226,7 @@
* synchronous so we can test immediately whether we want to
* proceed
*/
+ /*
if (hal_device_store_match_key_value_string (
hald_get_gdl (),
"linux.sysfs_path_device",
@@ -232,6 +234,8 @@
return NULL;
else
return d;
+ */
+ return d;
} else
return NULL;
Index: common.h
===================================================================
RCS file: /cvs/hal/hal/hald/linux/common.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- common.h 15 Aug 2004 18:54:57 -0000 1.7
+++ common.h 22 Aug 2004 19:27:22 -0000 1.8
@@ -94,11 +94,10 @@
dbus_bool_t got_parent (const char *sysfs_path);
-extern dbus_bool_t hald_is_initialising;
-
extern char sysfs_mount_path[SYSFS_PATH_MAX];
+
/* @} */
#endif /* COMMON_H */
Index: osspec.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/osspec.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- osspec.c 15 Aug 2004 18:54:57 -0000 1.31
+++ osspec.c 22 Aug 2004 19:27:22 -0000 1.32
@@ -118,214 +118,11 @@
static void hald_helper_device_node (gboolean is_add, char *subsystem, char *sysfs_path, char *device_node);
static gboolean hald_helper_data (GIOChannel *source, GIOCondition condition, gpointer user_data);
-/**
- * @defgroup HalDaemonLinux Linux 2.6 support
- * @ingroup HalDaemon
- * @brief Device detection and monitoring code using Linux 2.6 + udev
- * @{
- */
+static HalDevice *add_device (const char *sysfs_path, const char *subsystem);
[...1195 lines suppressed...]
@@ -928,9 +1253,11 @@
msg.seqnum, last_hotplug_seqnum, msg.subsystem, msg.sysfs_path));*/
if (last_hotplug_seqnum == -1 ) {
- /* gotta start somewhere; however sleep one second to allow
+ /* gotta start somewhere; however sleep some time to allow
* some more hotplug events to propagate so we know where
* we're at.
+ *
+ * @todo TODO FIXME XXX: The kernel should probably export the last sent SEQNUM in sysfs
*/
HAL_WARNING (("First SEQNUM=%d; sleeping 2500ms to get a few more events", msg.seqnum));
@@ -962,5 +1289,3 @@
out:
return TRUE;
}
-
-/** @} */
More information about the hal-commit
mailing list