From patchwork Thu May 9 15:41:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasilis LIaskovitis X-Patchwork-Id: 10937295 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 97ADB933 for ; Thu, 9 May 2019 15:43:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 880D528B25 for ; Thu, 9 May 2019 15:43:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C3BB28B72; Thu, 9 May 2019 15:43:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1794428B25 for ; Thu, 9 May 2019 15:43:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOlB4-0007ep-Qo; Thu, 09 May 2019 15:41:46 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOlB3-0007eS-OF for xen-devel@lists.xenproject.org; Thu, 09 May 2019 15:41:45 +0000 X-Inumbo-ID: f2696504-7270-11e9-8980-bc764e045a96 Received: from smtp.nue.novell.com (unknown [195.135.221.5]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id f2696504-7270-11e9-8980-bc764e045a96; Thu, 09 May 2019 15:41:45 +0000 (UTC) Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Thu, 09 May 2019 17:41:43 +0200 Received: from linux-nq5u.suse.de (nwb-a10-snat.microfocus.com [10.120.13.202]) by emea4-mta.ukb.novell.com with ESMTP (NOT encrypted); Thu, 09 May 2019 16:41:34 +0100 From: Vasilis Liaskovitis To: xen-devel@lists.xenproject.org Date: Thu, 9 May 2019 17:41:28 +0200 Message-Id: <20190509154128.9196-5-vliaskovitis@suse.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190509154128.9196-1-vliaskovitis@suse.com> References: <20190509154128.9196-1-vliaskovitis@suse.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 4/4] xl: add new xl command get-parameters 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: jgross@suse.com, sstabellini@kernel.org, wei.liu2@citrix.com, vliaskovitis@suse.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, tim@xen.org, jbeulich@suse.com, dgdegra@tycho.nsa.gov Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add a new xl command "get-parameters" to get hypervisor runtime parameters. Examples: xl get-parameters "gnttab_max_frames gnttab_max_maptrack_frames" gnttab_max_frames gnttab_max_maptrack_frames : 64 1024 xl set-parameters gnttab_max_frames=128 xl get-parameters gnttab_max_frames gnttab_max_frames : 128 xl get-parameters "gnttab_max_frames gnttab_max_maptrack_frames" gnttab_max_frames gnttab_max_maptrack_frames : 128 1024 Signed-off-by: Vasilis Liaskovitis --- docs/man/xl.1.pod.in | 5 +++++ tools/xl/xl.h | 1 + tools/xl/xl_cmdtable.c | 5 +++++ tools/xl/xl_misc.c | 25 +++++++++++++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in index 4310fcd818..a1fff4d382 100644 --- a/docs/man/xl.1.pod.in +++ b/docs/man/xl.1.pod.in @@ -827,6 +827,11 @@ Send debug I to Xen. It is the same as pressing the Xen Set hypervisor parameters as specified in I. This allows for some boot parameters of the hypervisor to be modified in the running systems. +=item B I + +Get hypervisor parameters as specified in I. This allows for some +boot parameters of the hypervisor to be read in the running systems. + =item B [I] Reads the Xen message buffer, similar to dmesg on a Linux system. The diff --git a/tools/xl/xl.h b/tools/xl/xl.h index cf4202bc89..af3843e5b0 100644 --- a/tools/xl/xl.h +++ b/tools/xl/xl.h @@ -219,6 +219,7 @@ int main_psr_mba_set(int argc, char **argv); int main_psr_mba_show(int argc, char **argv); #endif int main_qemu_monitor_command(int argc, char **argv); +int main_get_parameters(int argc, char **argv); void help(const char *command); diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c index 89716badcb..a18481619b 100644 --- a/tools/xl/xl_cmdtable.c +++ b/tools/xl/xl_cmdtable.c @@ -662,6 +662,11 @@ struct cmd_spec cmd_table[] = { "Issue a qemu monitor command to the device model of a domain", " ", }, + { "get-parameters", + &main_get_parameters, 0, 1, + "Get hypervisor parameters", + "", + }, }; int cmdtable_len = sizeof(cmd_table)/sizeof(struct cmd_spec); diff --git a/tools/xl/xl_misc.c b/tools/xl/xl_misc.c index dcf940a6d4..811f231b78 100644 --- a/tools/xl/xl_misc.c +++ b/tools/xl/xl_misc.c @@ -364,6 +364,31 @@ int main_config_update(int argc, char **argv) return 0; } +int main_get_parameters(int argc, char **argv) +{ + int opt, ret; + char *params; + char values[1023]; + + SWITCH_FOREACH_OPT(opt, "", NULL, "get-parameters", 1) { + /* No options */ + } + + params = argv[optind]; + + if (!params) { + fprintf(stderr, "no parameter specified\n"); + return EXIT_FAILURE; + } + else if ((ret = libxl_get_parameters(ctx, params, values))) { + fprintf(stderr, "cannot get parameters: %s : %d\n", params, ret); + fprintf(stderr, "Use \"xl dmesg\" to look for possible reason.\n"); + return EXIT_FAILURE; + } + fprintf(stderr, "%s : %s\n", params, values); + + return EXIT_SUCCESS; +} /* * Local variables: * mode: C