]> git.ozlabs.org Git - petitboot/commitdiff
discover: move device sources to the device handler
authorJeremy Kerr <jk@ozlabs.org>
Wed, 2 Apr 2014 06:08:26 +0000 (14:08 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Wed, 2 Apr 2014 06:08:26 +0000 (14:08 +0800)
Currently, the pb-discover main() function initialises the device
handler and the device sources.

We want to eventually be able to re-init the device sources, which will
be initiated by the handler. In this case, the handler will need
references to the sources.

This change moves the creation of the device sources to be internal to
the handler. This way, the device handler gets a reference to
everything, without having to pass pointers around in main().

We also remove the _destroy functions, as we handle everything through
talloc destructors, as all sources are parented to the handler. We also
change user_event_init and udev_init to take the handler as the first
('context') argument, to make them consistent with network_init.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

No differences found