From patchwork Tue Jan 28 14:28:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11354399 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 0EEDD1398 for ; Tue, 28 Jan 2020 14:29:38 +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 E98B521739 for ; Tue, 28 Jan 2020 14:29:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E98B521739 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com 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 1iwRqv-0002Y9-Od; Tue, 28 Jan 2020 14:28:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iwRqt-0002X9-OV for xen-devel@lists.xenproject.org; Tue, 28 Jan 2020 14:28:27 +0000 X-Inumbo-ID: 6f8d1e00-41da-11ea-8396-bc764e2007e4 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6f8d1e00-41da-11ea-8396-bc764e2007e4; Tue, 28 Jan 2020 14:28:22 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 91255ACF2; Tue, 28 Jan 2020 14:28:21 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Tue, 28 Jan 2020 15:28:18 +0100 Message-Id: <20200128142818.27200-4-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200128142818.27200-1-jgross@suse.com> References: <20200128142818.27200-1-jgross@suse.com> Subject: [Xen-devel] [PATCH 3/3] xenstore: remove not applicable control commands in stubdom 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: Juergen Gross , Ian Jackson , Wei Liu MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" When run in a stubdom environment Xenstore can't select a logfile or emit memory statistics to a specific file. So remove or modify those control commands accordingly. Signed-off-by: Juergen Gross Acked-by: Andrew Cooper --- 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..8d48ab4820 100644 --- a/tools/xenstore/xenstored_control.c +++ b/tools/xenstore/xenstored_control.c @@ -61,6 +61,19 @@ static int do_control_log(void *ctx, struct connection *conn, return 0; } +#ifdef __MINIOS__ +static int do_control_memreport(void *ctx, struct connection *conn, + char **vec, int num) +{ + if (num) + return EINVAL; + + talloc_report_full(NULL, stdout); + + send_ack(conn, XS_CONTROL); + return 0; +} +#else static int do_control_logfile(void *ctx, struct connection *conn, char **vec, int num) { @@ -114,6 +127,7 @@ static int do_control_memreport(void *ctx, struct connection *conn, send_ack(conn, XS_CONTROL); return 0; } +#endif static int do_control_print(void *ctx, struct connection *conn, char **vec, int num) @@ -132,8 +146,12 @@ static int do_control_help(void *, struct connection *, char **, int); static struct cmd_s cmds[] = { { "check", do_control_check, "" }, { "log", do_control_log, "on|off" }, +#ifdef __MINIOS__ + { "memreport", do_control_memreport, "" }, +#else { "logfile", do_control_logfile, "" }, { "memreport", do_control_memreport, "[]" }, +#endif { "print", do_control_print, "" }, { "help", do_control_help, "" }, };