[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 50/52] libxl: add libxl_set_parameters() function



On Wed, Aug 09, 2017 at 09:07:04AM +0200, Juergen Gross wrote:
> 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>
> ---
>  tools/libxl/libxl.c | 14 ++++++++++++++
>  tools/libxl/libxl.h | 11 +++++++++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 0ef874406f..f370e445de 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -652,6 +652,20 @@ 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 ) {

Extraneous spaces.

> +        LOGE(ERROR, "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..e8262501c2 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);
> @@ -2106,6 +2113,10 @@ int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid,
>  int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq);
>  int libxl_send_debug_keys(libxl_ctx *ctx, char *keys);
>  
> +#ifdef LIBXL_HAVE_SET_PARAMETERS
> +int libxl_set_parameters(libxl_ctx *ctx, char *params);
> +#endif
> +

No need to have this enclosed in macro.

>  typedef struct libxl__xen_console_reader libxl_xen_console_reader;
>  
>  libxl_xen_console_reader *
> -- 
> 2.12.3
> 

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.