diff options
author | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2016-07-26 15:45:37 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2016-08-08 13:52:50 +1000 |
commit | 83a587b79e9a5a5279f1c7a26918fc8c08523a7f (patch) | |
tree | 353a9aff1c1207d3dcb44832606cbc5088218d42 /discover/event.c | |
parent | 297d2f0cc9c0a233fadf42dacc08708ad3909f77 (diff) | |
download | talos-petitboot-83a587b79e9a5a5279f1c7a26918fc8c08523a7f.tar.gz talos-petitboot-83a587b79e9a5a5279f1c7a26918fc8c08523a7f.zip |
discover: Add 'sync' user event
Add a user event named 'sync' that causes the discover server to merge
the devicemapper snapshots of mounted devices. This is particularly
useful as a debug aid (for example, when copying logs to a USB device),
as the server will otherwise only sync changes to mounted devices in
response to parser actions.
The command can be called as
pb-event sync@device
to sync a particular device, or as
pb-event sync@all
to sync all devices with snapshots.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/event.c')
-rw-r--r-- | discover/event.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/discover/event.c b/discover/event.c index 8b3a1ab..242ae81 100644 --- a/discover/event.c +++ b/discover/event.c @@ -55,6 +55,8 @@ static int event_parse_ad_header(char *buf, int len, enum event_action *action, *action = EVENT_ACTION_DHCP; else if (streq(buf, "boot")) *action = EVENT_ACTION_BOOT; + else if (streq(buf, "sync")) + *action = EVENT_ACTION_SYNC; else { pb_log("%s: unknown action: %s\n", __func__, buf); return -1; |