xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>, Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [PATCH v5 12/15] libxc: add function to set hypervisor parameters
Date: Mon, 28 Aug 2017 09:34:47 +0200	[thread overview]
Message-ID: <20170828073450.12024-13-jgross@suse.com> (raw)
In-Reply-To: <20170828073450.12024-1-jgross@suse.com>

Add a new libxc function to set hypervisor parameters at runtime
similar to boot time parameters via command line.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
V3:
- zero padding fields in sysctl.u.set_parameter
---
 tools/libxc/include/xenctrl.h |  1 +
 tools/libxc/xc_misc.c         | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index c7710b8f36..ad5e6b3d77 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1210,6 +1210,7 @@ int xc_readconsolering(xc_interface *xch,
                        int clear, int incremental, uint32_t *pindex);
 
 int xc_send_debug_keys(xc_interface *xch, char *keys);
+int xc_set_parameters(xc_interface *xch, char *params);
 
 typedef xen_sysctl_physinfo_t xc_physinfo_t;
 typedef xen_sysctl_cputopo_t xc_cputopo_t;
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 2303293c6c..7e15e904e3 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -187,6 +187,27 @@ int xc_send_debug_keys(xc_interface *xch, char *keys)
     return ret;
 }
 
+int xc_set_parameters(xc_interface *xch, char *params)
+{
+    int ret, len = strlen(params);
+    DECLARE_SYSCTL;
+    DECLARE_HYPERCALL_BOUNCE(params, len, XC_HYPERCALL_BUFFER_BOUNCE_IN);
+
+    if ( xc_hypercall_bounce_pre(xch, params) )
+        return -1;
+
+    sysctl.cmd = XEN_SYSCTL_set_parameter;
+    set_xen_guest_handle(sysctl.u.set_parameter.params, params);
+    sysctl.u.set_parameter.size = len;
+    memset(sysctl.u.set_parameter.pad, 0, sizeof(sysctl.u.set_parameter.pad));
+
+    ret = do_sysctl(xch, &sysctl);
+
+    xc_hypercall_bounce_post(xch, params);
+
+    return ret;
+}
+
 int xc_physinfo(xc_interface *xch,
                 xc_physinfo_t *put_info)
 {
-- 
2.12.3


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-08-28  7:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28  7:34 [PATCH v5 00/15] Support for modifying parameters at runtime Juergen Gross
2017-08-28  7:34 ` [PATCH v5 01/15] xen/arch/x86/psr.c: let custom parameter parsing routines return errno Juergen Gross
2017-08-28  8:40   ` Jan Beulich
2017-08-28  7:34 ` [PATCH v5 02/15] xen: check parameter validity when parsing command line Juergen Gross
2017-08-28  7:34 ` [PATCH v5 03/15] xen/arch/x86/apic.c: remove custom_param() error messages Juergen Gross
2017-08-28  7:34 ` [PATCH v5 04/15] xen/arch/x86/cpu/mcheck/mce.c: " Juergen Gross
2017-08-28  7:34 ` [PATCH v5 05/15] xen/arch/x86/hvm/viridian.c: " Juergen Gross
2017-08-28  7:34 ` [PATCH v5 06/15] xen/arch/x86/io_apic.c: " Juergen Gross
2017-08-28  7:34 ` [PATCH v5 07/15] xen/common/kexec.c: " Juergen Gross
2017-08-28  7:34 ` [PATCH v5 08/15] xen/common/sched_credit2.c: " Juergen Gross
2017-08-28  7:34 ` [PATCH v5 09/15] xen: carve out a generic parsing function from _cmdline_parse() Juergen Gross
2017-08-28  7:34 ` [PATCH v5 10/15] xen: add basic support for runtime parameter changing Juergen Gross
2017-08-28  7:34 ` [PATCH v5 11/15] xen: add hypercall for setting parameters at runtime Juergen Gross
2017-08-28  7:34 ` Juergen Gross [this message]
2017-08-28  7:34 ` [PATCH v5 13/15] libxl: add libxl_set_parameters() function Juergen Gross
2017-08-28  7:34 ` [PATCH v5 14/15] xl: add new xl command set-parameters Juergen Gross
2017-08-28  7:34 ` [PATCH v5 15/15] xen: make some console related parameters settable at runtime 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=20170828073450.12024-13-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=ian.jackson@eu.citrix.com \
    --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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).