From patchwork Wed Dec 4 09:27:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Dingwall X-Patchwork-Id: 11272547 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D097114B7 for ; Wed, 4 Dec 2019 09:28:43 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B56C120675 for ; Wed, 4 Dec 2019 09:28:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B56C120675 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dingwall.me.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1icQwQ-0001qn-VA; Wed, 04 Dec 2019 09:27:26 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1icQwQ-0001qd-4f for xen-devel@lists.xenproject.org; Wed, 04 Dec 2019 09:27:26 +0000 X-Inumbo-ID: 47705d2b-1678-11ea-81fe-12813bfff9fa Received: from know-smtprelay-omc-1.server.virginmedia.net (unknown [80.0.253.65]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 47705d2b-1678-11ea-81fe-12813bfff9fa; Wed, 04 Dec 2019 09:27:24 +0000 (UTC) Received: from mail0.xen.dingwall.me.uk ([82.47.84.47]) by cmsmtp with ESMTPA id cQwNiY5hqxs8ecQwNioh3X; Wed, 04 Dec 2019 09:27:23 +0000 X-Originating-IP: [82.47.84.47] X-Authenticated-User: james.dingwall@blueyonder.co.uk X-Spam: 0 X-Authority: v=2.3 cv=L98zvdb8 c=1 sm=1 tr=0 a=0bfgdX8EJi0Cr9X0x0jFDA==:117 a=0bfgdX8EJi0Cr9X0x0jFDA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=xqWC_Br6kY4A:10 a=pxVhFHJ0LMsA:10 a=5IRWAbXhAAAA:8 a=Sk5AkFDSzmZvWLMj57EA:9 a=G6QAcT8NE79V4_GB:21 a=pniMzHNUB-FszkVU:21 a=xo7gz2vLY8DhO4BdlxfM:22 Received: from localhost (localhost [IPv6:::1]) by mail0.xen.dingwall.me.uk (Postfix) with ESMTP id E9B07159423; Wed, 4 Dec 2019 09:27:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at dingwall.me.uk Received: from mail0.xen.dingwall.me.uk ([IPv6:::1]) by localhost (mail0.xen.dingwall.me.uk [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id K8vWBOZ4fSQp; Wed, 4 Dec 2019 09:27:41 +0000 (UTC) Received: from behemoth.dingwall.me.uk (behemoth.dingwall.me.uk [IPv6:2001:470:695c:302::c0a8:105]) by dingwall.me.uk (Postfix) with ESMTP id 8ADB9159415; Wed, 4 Dec 2019 09:27:41 +0000 (UTC) Received: by behemoth.dingwall.me.uk (Postfix, from userid 1000) id 8EC0B140E19; Wed, 4 Dec 2019 09:27:41 +0000 (UTC) From: james-xen@dingwall.me.uk To: xen-devel@lists.xenproject.org Date: Wed, 4 Dec 2019 09:27:37 +0000 Message-Id: <20191204092739.18177-3-james-xen@dingwall.me.uk> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204092739.18177-1-james-xen@dingwall.me.uk> References: <20191204092739.18177-1-james-xen@dingwall.me.uk> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfKZJoxklV5Q0Crbpl0ZLACJxmaLTqKK6ekPEx8uMnDO5p1kjjD1esGp12wJKNL49IdkWu7Gf7CztIe8p8YMUwMzuIKFOUprkyINvei5hZ1YXg7gtsnRl 5FtC7oEvAQNu+j0pAzSVopzAkwDJG+E603ho9qrM1KK7A9g13YbqQg1D7xjI5wm2evASO8HKBoYuUgcFh65K0Omec8bRgQzAsYtHn8CwyxL+ByavkDOFYH+c cKHD2q24E0ilvqeb+l33P6e5wJVQ+iaquWicJ7YTp5E= Subject: [Xen-devel] [PATCH 2/4] xenstored logging: add control to dynamically toggle tracesyslog flag X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com, James Dingwall Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: James Dingwall 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, "" }, + { "syslog", do_control_logsyslog, "on|off" }, { "memreport", do_control_memreport, "[]" }, { "print", do_control_print, "" }, { "help", do_control_help, "" },