Message ID | 20240329111056.6118-1-leigh@solinno.co.uk (mailing list archive) |
---|---|
Headers | show |
Series | xenwatchdogd bugfixes and enhancements | expand |
On Fri, Mar 29, 2024 at 11:10:50AM +0000, leigh@solinno.co.uk wrote: > From: Leigh Brown <leigh@solinno.co.uk> > > The primary intention of this patch series is to replace the > pathologically bad behaviour of rebooting the domain if you run > "xenwatchdogd -h". To that end, I have implemented comprehensive > argument validation. This validation ensures you can't pass > arguments that instantly reboot the domain or cause it to spin > loop running sleep(0) repeatedly. > > I added a couple of enhancements whilst working on the changes as > they were easy enough. In particular, being able to run in the > foreground, disarming the watchdog on exit, help and a manpage. > > Changes since v1: > - Add Signed-off-by on every patch. > - Make global variables static. > > Full list of changes: > - Use getopt_long() to add -h/--help with associated usage help. > - Add -F/--foreground parameter to run without daemonizing. > - Add -x/--save-exit parameter to disarm the watchdog when exiting. > - Validate timeout is numeric and is at least two seconds. > - Validate sleep is numeric and is at least one and less than timeout. > - Check for too many arguments. > - Use symbol constants instead of magic numbers where possible. > - Make all functions except main() and global variables static. > - Add a manual page for xenwatchdogd(). It might be worth mentioning something about these in the CHANGELOG. Probably not need to go into detail, maybe just "improved xenwatchdogd options, see new man page." Cheers,
From: Leigh Brown <leigh@solinno.co.uk> The primary intention of this patch series is to replace the pathologically bad behaviour of rebooting the domain if you run "xenwatchdogd -h". To that end, I have implemented comprehensive argument validation. This validation ensures you can't pass arguments that instantly reboot the domain or cause it to spin loop running sleep(0) repeatedly. I added a couple of enhancements whilst working on the changes as they were easy enough. In particular, being able to run in the foreground, disarming the watchdog on exit, help and a manpage. Changes since v1: - Add Signed-off-by on every patch. - Make global variables static. Full list of changes: - Use getopt_long() to add -h/--help with associated usage help. - Add -F/--foreground parameter to run without daemonizing. - Add -x/--save-exit parameter to disarm the watchdog when exiting. - Validate timeout is numeric and is at least two seconds. - Validate sleep is numeric and is at least one and less than timeout. - Check for too many arguments. - Use symbol constants instead of magic numbers where possible. - Make all functions except main() and global variables static. - Add a manual page for xenwatchdogd(). Leigh Brown (6): tools/misc: xenwatchdogd: use EXIT_* constants tools/misc: rework xenwatchdogd signal handling tools/misc: xenwatchdogd: add static qualifier tools/misc: xenwatchdogd: add parse_secs() tools/misc: xenwatchdogd enhancements docs/man: Add xenwatchdog manual page docs/man/xenwatchdogd.8.pod | 54 +++++++++++ tools/misc/xenwatchdogd.c | 182 ++++++++++++++++++++++++++++-------- 2 files changed, 196 insertions(+), 40 deletions(-) create mode 100644 docs/man/xenwatchdogd.8.pod