summaryrefslogtreecommitdiffstats
path: root/discover/discover-server.c
Commit message (Collapse)AuthorAgeFilesLines
* protocol: Separate device add from boot-option add messagesJeremy Kerr2013-04-161-9/+41
| | | | | | | | | | | | | | | | | | | | We want to cater for situations where boot options may be discovered some time after we get notificiation about devices. For instance, discovering boot options from DHCP configuration parameters. In this case, we'll need to notify UIs of boot options appear some time after the device (and/or other boot options on the same device) has appeared. This change adds a new protocol message type, PB_PROTOCOL_ACTION_BOOT_OPTION_ADD. We also rename PB_PROTOCOL_ACTION_ADD to make it clear that it is just for devices. The discover server is updated to send boot option add events at device discover time, but we are now able to decouple this later. We also update the clients to handle the boot option add events separately. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pb-protocol: Don't allocate in deserialise functionsJeremy Kerr2013-04-161-2/+5
| | | | | | | | | | | | | Curently, the protocol deserialise functions are allocating device and boot_command structures. This (implicitly) makes them responsible for initialisation of these structures too. Rather that making the protocol responsible for initialising the devices and boot commands, this change gives the deserialise functions an argument to an already-instanciated structure. This means that the creation is no longer implied by the deserialise. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Implement device handler boot pathJeremy Kerr2013-04-151-1/+1
| | | | | | | | | | This change adds a funtion, device_handler_boot, which processes the boot command message from the discover server. We add a new file, discover/boot.c (and a corresponding header) with a skeleton for the final kexec code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: parse boot message from incoming ACTION_BOOT messagesJeremy Kerr2013-04-151-1/+9
| | | | | | | Add a function in the protocol code to deserialise a boot message, and use it to extract a boot_command in the discover server. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover-server: Add reference to server in struct clientJeremy Kerr2013-04-151-0/+2
| | | | | | We'll need to reference the server when handling messages from clients. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Allow discover server to receive boot messagesJeremy Kerr2013-04-151-2/+24
| | | | | | | | | | | | | | | Currently, the petitboot socket is one way: messages are only sent from server to client. Beause we want the clients to trigger a boot, this change allows the server to receive messages on the petitboot socket. This is just a matter of adding a waiter to the client-specific socket, then handling incoming messages. At present we don't do anything with the messages, but we'll add a handler later. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* waiter: Don't rely on global variables to keep waiter stateJeremy Kerr2013-04-101-3/+5
| | | | | | | | | Rather than defining the set of waiters (and pollfds) in waiter.c, add a struct waitset to contain these. A waitset is created with waitset_create, which is passed to the waiter_* functions. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add discover device reportGeoff Levand2009-06-301-5/+7
| | | | | | | | | | Fillout the missing discover code that reports current devices. Replaces device_handler_get_current_devices() with two new accessor routines device_handler_get_device_count() and device_handler_get_device(). Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Log server messages to fileGeoff Levand2009-03-231-2/+2
| | | | | | | Log discover server messages to a file. Helps in debugging the server when is has problems at system startup. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
* Make device instance constantGeoff Levand2009-02-011-2/+2
| | | | | | | Make the instance of devices read-only. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Move log to libraryGeoff Levand2009-02-011-1/+1
| | | | | | | | | | | Move the log routines to the petitboot library. The log routines are generic enough to be used for both server and client. Does not change the log source. jk: move to lib/log/ instead of lib/ Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Move waiter to libraryGeoff Levand2009-02-011-1/+1
| | | | | | | | | | | Move the waiter routines into the petitboot library. The waiter routines are generic enough to be used for both server and client. Does not change the waiter source. jk: move to lib/waiter/ instead of lib/ Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Fix unused parameter warningsJeremy Kerr2009-02-011-1/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Fix build warningsGeoff Levand2009-02-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | Fix various minor build warnings: lib/pb-protocol/pb-protocol.c:72: warning: comparison between signed and unsigned lib/pb-protocol/pb-protocol.c:78: warning: comparison between signed and unsigned lib/pb-protocol/pb-protocol.c:141: warning: unused parameter 'buf_len' lib/pb-protocol/pb-protocol.c:241: warning: comparison between signed and unsigned discover/pb-discover.c:14: warning: no previous prototype for 'sigint_handler' discover/pb-discover.c:13: warning: unused parameter 'signum' discover/log.c:22: warning: no previous prototype for 'pb_log_set_stream' discover/discover-server.c:159: warning: no previous prototype for 'discover_server_notify_add' discover/discover-server.c:169: warning: no previous prototype for 'discover_server_notify_remove' discover/discover-server.c:179: warning: no previous prototype for 'discover_server_set_device_source' discover/discover-server.c:184: warning: no previous prototype for 'discover_server_init' discover/discover-server.c:229: warning: no previous prototype for 'discover_server_destroy' discover/device-handler.c:395: warning: comparison between signed and unsigned discover/paths.c:44: warning: comparison between signed and unsigned Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Hook up parsers to device discoveryJeremy Kerr2009-01-021-0/+20
| | | | | | | | Iterate the parsers from the device handler on an add event. Initial change to just the kboot parser. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Remove reference to device.hJeremy Kerr2008-12-311-1/+0
| | | | | | It isn't needed anymore. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Create device-handler for managing registered devicesJeremy Kerr2008-12-151-29/+15
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Initial support for multiple UIsJeremy Kerr2008-12-151-0/+227
Move the device discovery code from separate udev helpers to a single process to listen on two sockets: one SOCK_DGRAM for incoming udev events, and one SOCK_STREAM for UIs to connect. Initial support for client/server infrastructure, still need to wire-up the udev messages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud