From nobody Thu Apr 25 09:51:29 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1557416594; cv=none; d=zoho.com; s=zohoarc; b=djyLFO0HR7V+Vl5aEuBVWntf07+rQOKFB3YdxsYEknqItFb+nuCd5PDk9ZruJ8USegCwalAUZCDBkXbUbErN9KCvLoS1SG8u4X2jnq7C32fhrf9i/sM5MoL4TM84a2YgqgcOxihmAMkyC7yCCVkvnRTQP7gVq3uFHALDk2rKBTg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557416594; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=jhBhfdrsBpP6Bb12uqxQrhYRatGkS+BrEiuUp4f60og=; b=f+v1DjKr7HpMbKrEaixKRQeQdWl6qFp2KTBpobcgj7NoEwIxplxNM4vMRyHJrgN4+N2lg1miwbdrxQi/2Ye3VnaOdoQob6l1ephd6nO7njzPzoF8g4aIN/piXZ6mZl5UI1O8kp/uSu+uZ3veJ0bpbV3igD0+qyzKYoE+gnhlNLA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1557416594561859.6289340663693; Thu, 9 May 2019 08:43:14 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOlB3-0007eX-VA; Thu, 09 May 2019 15:41:45 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOlB2-0007eD-HN for xen-devel@lists.xenproject.org; Thu, 09 May 2019 15:41:44 +0000 Received: from smtp.nue.novell.com (unknown [195.135.221.5]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id f165be5c-7270-11e9-8980-bc764e045a96; Thu, 09 May 2019 15:41:43 +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:41 +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:33 +0100 X-Inumbo-ID: f165be5c-7270-11e9-8980-bc764e045a96 From: Vasilis Liaskovitis To: xen-devel@lists.xenproject.org Date: Thu, 9 May 2019 17:41:26 +0200 Message-Id: <20190509154128.9196-3-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 2/4] libxc: add function to get hypervisor 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Add a new libxc function to get hypervisor parameters. Signed-off-by: Vasilis Liaskovitis --- tools/libxc/include/xenctrl.h | 1 + tools/libxc/xc_misc.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index a3628e56bb..3482ca1a91 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1228,6 +1228,7 @@ int xc_readconsolering(xc_interface *xch, =20 int xc_send_debug_keys(xc_interface *xch, char *keys); int xc_set_parameters(xc_interface *xch, char *params); +int xc_get_parameters(xc_interface *xch, char *params, char *values); =20 typedef struct xen_sysctl_physinfo xc_physinfo_t; typedef struct xen_sysctl_cputopo xc_cputopo_t; diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c index 5e6714ae2b..439ad91194 100644 --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -208,6 +208,32 @@ int xc_set_parameters(xc_interface *xch, char *params) return ret; } =20 +int xc_get_parameters(xc_interface *xch, char *params, char *values) +{ + int ret, len =3D strlen(params); + DECLARE_SYSCTL; + DECLARE_HYPERCALL_BOUNCE(params, len, XC_HYPERCALL_BUFFER_BOUNCE_IN); + DECLARE_HYPERCALL_BOUNCE(values, 1023, XC_HYPERCALL_BUFFER_BOUNCE_OUT); + + if ( xc_hypercall_bounce_pre(xch, params) ) + return -1; + if ( xc_hypercall_bounce_pre(xch, values) ) + return -1; + + sysctl.cmd =3D XEN_SYSCTL_get_parameter; + set_xen_guest_handle(sysctl.u.get_parameter.params, params); + set_xen_guest_handle(sysctl.u.get_parameter.values, values); + sysctl.u.get_parameter.size =3D len; + memset(sysctl.u.get_parameter.pad, 0, sizeof(sysctl.u.get_parameter.pa= d)); + + ret =3D do_sysctl(xch, &sysctl); + + xc_hypercall_bounce_post(xch, params); + xc_hypercall_bounce_post(xch, values); + + return ret; +} + int xc_physinfo(xc_interface *xch, xc_physinfo_t *put_info) { --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel