[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 2/4] xenstored logging: add control to dynamically toggle tracesyslog flag
From: James Dingwall <james@xxxxxxxxxxxxxx> Add a new xenstore control command which allows the tracesyslog boolean to be changed at run time. --- tools/xenstore/xenstored_control.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c index e4b8aa95ab..120dc3aa98 100644 --- a/tools/xenstore/xenstored_control.c +++ b/tools/xenstore/xenstored_control.c @@ -76,6 +76,23 @@ static int do_control_logfile(void *ctx, struct connection *conn, return 0; } +static int do_control_logsyslog(void *ctx, struct connection *conn, + char **vec, int num) +{ + if (num != 1) + return EINVAL; + + if (!strcmp(vec[0], "on")) + tracesyslog = true; + else if (!strcmp(vec[0], "off")) + tracesyslog = false; + else + return EINVAL; + + send_ack(conn, XS_CONTROL); + return 0; +} + static int do_control_memreport(void *ctx, struct connection *conn, char **vec, int num) { @@ -133,6 +150,7 @@ static struct cmd_s cmds[] = { { "check", do_control_check, "" }, { "log", do_control_log, "on|off" }, { "logfile", do_control_logfile, "<file>" }, + { "syslog", do_control_logsyslog, "on|off" }, { "memreport", do_control_memreport, "[<file>]" }, { "print", do_control_print, "<string>" }, { "help", do_control_help, "" }, -- 2.24.0 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |