From patchwork Fri Mar 22 19:28:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasilis LIaskovitis X-Patchwork-Id: 10866429 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 C38B31575 for ; Fri, 22 Mar 2019 19:30:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC24A29A1D for ; Fri, 22 Mar 2019 19:30:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E5BE2A9BF; Fri, 22 Mar 2019 19:30:51 +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 5640629A1D for ; Fri, 22 Mar 2019 19:30:51 +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 1h7PqN-00053w-Fa; Fri, 22 Mar 2019 19:28:43 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h7PqM-00053X-6G for xen-devel@lists.xenproject.org; Fri, 22 Mar 2019 19:28:42 +0000 X-Inumbo-ID: b214fb10-4cd8-11e9-bc90-bc764e045a96 Received: from smtp.nue.novell.com (unknown [195.135.221.5]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id b214fb10-4cd8-11e9-bc90-bc764e045a96; 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:38 +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:08 +0100 Message-Id: <20190322192809.3002-4-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 3/4] libxl: add libxl_get_parameters() function 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 libxl function to get hypervisor parameters at runtime. Signed-off-by: Vasilis Liaskovitis --- tools/libxl/libxl.c | 15 +++++++++++++++ tools/libxl/libxl.h | 1 + 2 files changed, 16 insertions(+) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index ec71574e99..124033e5a3 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -669,6 +669,21 @@ int libxl_set_parameters(libxl_ctx *ctx, char *params) return 0; } +int libxl_get_parameters(libxl_ctx *ctx, char *params, char *values) +{ + int ret; + GC_INIT(ctx); + + ret = xc_get_parameters(ctx->xch, params, values); + if (ret < 0) { + LOGEV(ERROR, ret, "getting parameters"); + GC_FREE; + return ret;//ERROR_FAIL; + } + GC_FREE; + return 0; +} + static int fd_set_flags(libxl_ctx *ctx, int fd, int fcntlgetop, int fcntlsetop, const char *fl, int flagmask, int set_p) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index a38e5cdba2..360a757a06 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -2307,6 +2307,7 @@ int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid, int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq); int libxl_send_debug_keys(libxl_ctx *ctx, char *keys); int libxl_set_parameters(libxl_ctx *ctx, char *params); +int libxl_get_parameters(libxl_ctx *ctx, char *params, char *values); typedef struct libxl__xen_console_reader libxl_xen_console_reader;