@@ -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;
@@ -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)
{
Add a new libxc function to get hypervisor parameters at runtime. 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(+)