All of lore.kernel.org
 help / color / mirror / Atom feed
From: james-xen@dingwall.me.uk
To: xen-devel@lists.xenproject.org
Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com,
	James Dingwall <james@dingwall.me.uk>
Subject: [Xen-devel] [PATCH 2/4] xenstored logging: add control to dynamically toggle tracesyslog flag
Date: Wed,  4 Dec 2019 09:27:37 +0000	[thread overview]
Message-ID: <20191204092739.18177-3-james-xen@dingwall.me.uk> (raw)
In-Reply-To: <20191204092739.18177-1-james-xen@dingwall.me.uk>

From: James Dingwall <james@dingwall.me.uk>

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@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-12-04  9:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04  9:27 [Xen-devel] [PATCH 0/4] xenstore domain: improve logging capabilities james-xen
2019-12-04  9:27 ` [Xen-devel] [PATCH 1/4] xenstored logging: introduce -Y / --trace-syslog option james-xen
2019-12-04  9:27 ` james-xen [this message]
2019-12-04  9:27 ` [Xen-devel] [PATCH 3/4] xenstored logging: send trace messages to syslog james-xen
2019-12-04  9:27 ` [Xen-devel] [PATCH 4/4] xenstored logging: add minios variant of default_xprintf() james-xen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191204092739.18177-3-james-xen@dingwall.me.uk \
    --to=james-xen@dingwall.me.uk \
    --cc=ian.jackson@eu.citrix.com \
    --cc=james@dingwall.me.uk \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.