[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v5 13/15] libxl: add libxl_set_parameters() function
Add a new libxl 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> Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- V2: - corrected coding style (Wei Liu) - removed superfluous #ifdef (Wei Liu) V3: - use LOGEV() for error message --- tools/libxl/libxl.c | 15 +++++++++++++++ tools/libxl/libxl.h | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 0ef874406f..247c56cf83 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -652,6 +652,21 @@ int libxl_send_debug_keys(libxl_ctx *ctx, char *keys) return 0; } +int libxl_set_parameters(libxl_ctx *ctx, char *params) +{ + int ret; + GC_INIT(ctx); + + ret = xc_set_parameters(ctx->xch, params); + if (ret < 0) { + LOGEV(ERROR, ret, "setting parameters"); + GC_FREE; + return ERROR_FAIL; + } + GC_FREE; + return 0; +} + static int fd_set_flags(libxl_ctx *ctx, int fd, int fcntlgetop, int fcntlsetop, const char *fl, int flagmask, int set_p) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 229e289750..17045253ab 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -1051,6 +1051,13 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, const libxl_mac *src); */ #define LIBXL_HAVE_QED 1 +/* + * LIBXL_HAVE_SET_PARAMETERS + * + * If this is defined setting hypervisor parameters is supported. + */ +#define LIBXL_HAVE_SET_PARAMETERS 1 + typedef char **libxl_string_list; void libxl_string_list_dispose(libxl_string_list *sl); int libxl_string_list_length(const libxl_string_list *sl); @@ -2105,6 +2112,7 @@ int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid, libxl_trigger trigger, uint32_t vcpuid); int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq); int libxl_send_debug_keys(libxl_ctx *ctx, char *keys); +int libxl_set_parameters(libxl_ctx *ctx, char *params); typedef struct libxl__xen_console_reader libxl_xen_console_reader; -- 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 |