From: Vasilis Liaskovitis <vliaskovitis@suse.com> To: xen-devel@lists.xenproject.org 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, anthony.perard@citrix.com, dgdegra@tycho.nsa.gov Subject: [PATCH v4 2/4] libxc: add function to get hypervisor parameters Date: Tue, 28 May 2019 16:54:14 +0200 [thread overview] Message-ID: <20190528145416.16918-3-vliaskovitis@suse.com> (raw) In-Reply-To: <20190528145416.16918-1-vliaskovitis@suse.com> Add a new libxc function to get hypervisor parameters. Signed-off-by: Vasilis Liaskovitis <vliaskovitis@suse.com> --- 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, 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); 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; } +int xc_get_parameters(xc_interface *xch, char *params, char *values) +{ + int ret, len = 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 = 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 = len; + memset(sysctl.u.get_parameter.pad, 0, sizeof(sysctl.u.get_parameter.pad)); + + ret = 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) { -- 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
WARNING: multiple messages have this Message-ID (diff)
From: Vasilis Liaskovitis <vliaskovitis@suse.com> To: xen-devel@lists.xenproject.org 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, anthony.perard@citrix.com, dgdegra@tycho.nsa.gov Subject: [Xen-devel] [PATCH v4 2/4] libxc: add function to get hypervisor parameters Date: Tue, 28 May 2019 16:54:14 +0200 [thread overview] Message-ID: <20190528145416.16918-3-vliaskovitis@suse.com> (raw) Message-ID: <20190528145414.GvMPmOu2r4yYH4vtehTp-YNqb3HHRmotlp5jEQv0x7Y@z> (raw) In-Reply-To: <20190528145416.16918-1-vliaskovitis@suse.com> Add a new libxc function to get hypervisor parameters. Signed-off-by: Vasilis Liaskovitis <vliaskovitis@suse.com> --- 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, 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); 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; } +int xc_get_parameters(xc_interface *xch, char *params, char *values) +{ + int ret, len = 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 = 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 = len; + memset(sysctl.u.get_parameter.pad, 0, sizeof(sysctl.u.get_parameter.pad)); + + ret = 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) { -- 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-05-28 14:54 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-05-28 14:54 [PATCH v4 0/4] Support for reading runtime hypervisor parameters Vasilis Liaskovitis 2019-05-28 14:54 ` [Xen-devel] " Vasilis Liaskovitis 2019-05-28 14:54 ` [PATCH v4 1/4] xen: add hypercall for reading runtime parameters Vasilis Liaskovitis 2019-05-28 14:54 ` [Xen-devel] " Vasilis Liaskovitis 2019-06-07 13:49 ` Jan Beulich 2019-05-28 14:54 ` Vasilis Liaskovitis [this message] 2019-05-28 14:54 ` [Xen-devel] [PATCH v4 2/4] libxc: add function to get hypervisor parameters Vasilis Liaskovitis 2019-05-28 14:54 ` [PATCH v4 3/4] libxl: add libxl_get_parameters() function Vasilis Liaskovitis 2019-05-28 14:54 ` [Xen-devel] " Vasilis Liaskovitis 2019-05-28 14:54 ` [PATCH v4 4/4] xl: add new xl command get-parameters Vasilis Liaskovitis 2019-05-28 14:54 ` [Xen-devel] " Vasilis Liaskovitis 2019-07-15 4:27 ` [Xen-devel] [PATCH v4 0/4] Support for reading runtime hypervisor parameters Juergen Gross
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190528145416.16918-3-vliaskovitis@suse.com \ --to=vliaskovitis@suse.com \ --cc=George.Dunlap@eu.citrix.com \ --cc=andrew.cooper3@citrix.com \ --cc=anthony.perard@citrix.com \ --cc=dgdegra@tycho.nsa.gov \ --cc=ian.jackson@eu.citrix.com \ --cc=jbeulich@suse.com \ --cc=jgross@suse.com \ --cc=sstabellini@kernel.org \ --cc=tim@xen.org \ --cc=wei.liu2@citrix.com \ --cc=xen-devel@lists.xenproject.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.