From patchwork Fri Mar 22 19:28:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasilis LIaskovitis X-Patchwork-Id: 10866425 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 24BA017EF for ; Fri, 22 Mar 2019 19:30:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E9302A9BF for ; Fri, 22 Mar 2019 19:30:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 032D12A9C2; Fri, 22 Mar 2019 19:30:46 +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 91FAD2A9C1 for ; Fri, 22 Mar 2019 19:30:45 +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 1h7PqP-00054K-QY; Fri, 22 Mar 2019 19:28:45 +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 1h7PqN-000545-Ou for xen-devel@lists.xenproject.org; Fri, 22 Mar 2019 19:28:43 +0000 X-Inumbo-ID: b280b660-4cd8-11e9-8920-17c4e61c4498 Received: from smtp.nue.novell.com (unknown [195.135.221.5]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b280b660-4cd8-11e9-8920-17c4e61c4498; Fri, 22 Mar 2019 19:28:40 +0000 (UTC) Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Fri, 22 Mar 2019 20:28:39 +0100 Received: from linux-nq5u.suse.de (nwb-a10-snat.microfocus.com [10.120.13.201]) by emea4-mta.ukb.novell.com with ESMTP (NOT encrypted); Fri, 22 Mar 2019 19:28:33 +0000 From: Vasilis Liaskovitis To: xen-devel@lists.xenproject.org Date: Fri, 22 Mar 2019 20:28:09 +0100 Message-Id: <20190322192809.3002-5-vliaskovitis@suse.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190322192809.3002-1-vliaskovitis@suse.com> References: <20190322192809.3002-1-vliaskovitis@suse.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 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, jbeulich@suse.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, tim@xen.org, vliaskovitis@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 parameters at runtime. 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