[PATCH] fix mapping of chassitype to system.formfactor
Artem Kachitchkine
Artem.Kachitchkin at Sun.COM
Wed May 10 02:52:50 PDT 2006
> Sure you can. During coldplug everything in hald is serialized through
> the mainloop.
Just to clarify. I didn't mean glib mainloop in particular, just the
serialization concept.
What happens during coldplug is for each device a hotplug event
structure is allocated and queued (hotplug_event_enqueue()). Nothing get
processed for now, no probing, not even TDL. At the end of this process
there is only one very long queue of synthesized hotplug events.
Then hotplug_event_process_queue() gets called and that's when things
start happening. An event gets unqueued, a device object is put on TDL,
it goes through three phases: preprobing, probing (when probe is run),
post-probing (when callouts are run). All this happens sequentially,
there is no parallelization here (regretfully, as was discussed some
time ago). Once a device is fully processed, it is moved to GDL (or
thrown away), and hotplug_event_process_queue() is called again. Until
the queue is empty.
So you should be able to do your stuff in post-probing. Here's an
example from blockdev:
/* probe the device */
hald_runner_run(d,
"hald-probe-storage", NULL,
HAL_HELPER_TIMEOUT,
add_blockdev_probing_helper_done,
(gpointer) end_token, NULL);
Hald will wait until the hald-probe-storage process exits and call
add_blockdev_probing_helper_done(). That's when it can consume the
properties collected by the probe and do the right thing.
-Artem.
More information about the hal
mailing list