|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 49/52] libxc: add function to set hypervisor parameters
Add a new libxc function to set hypervisor parameters at runtime
similar to boot time parameters via command line.
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
tools/libxc/include/xenctrl.h | 1 +
tools/libxc/xc_misc.c | 20 ++++++++++++++++++++
2 files changed, 21 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..5a34151dd3 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -187,6 +187,26 @@ 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;
+
+ 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@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |