@@ -6599,6 +6599,46 @@ int libxl_send_debug_keys(libxl_ctx *ctx, char *keys)
return 0;
}
+int libxl_set_log_level(libxl_ctx *ctx, bool guest,
+ char *lower_thresh, char *upper_thresh)
+{
+ int rc, ret;
+ GC_INIT(ctx);
+
+ ret = xc_set_log_level(ctx->xch, guest, lower_thresh, upper_thresh);
+ if (ret) {
+ LOGE(ERROR, "unable to set log level");
+ rc = ERROR_FAIL;
+ goto out;
+ }
+
+ rc = 0;
+out:
+ GC_FREE;
+ return rc;
+}
+
+int libxl_get_log_level(libxl_ctx *ctx, bool guest,
+ char *lower_thresh, unsigned int *lower_thresh_bufsize,
+ char *upper_thresh, unsigned int *upper_thresh_bufsize)
+{
+ int rc, ret;
+ GC_INIT(ctx);
+
+ ret = xc_get_log_level(ctx->xch, guest, lower_thresh, lower_thresh_bufsize,
+ upper_thresh, upper_thresh_bufsize);
+ if (ret) {
+ LOGE(ERROR, "unable to get log level");
+ rc = ERROR_FAIL;
+ goto out;
+ }
+
+ rc = 0;
+out:
+ GC_FREE;
+ return rc;
+}
+
libxl_xen_console_reader *
libxl_xen_console_read_start(libxl_ctx *ctx, int clear)
{
@@ -67,6 +67,12 @@
* the same $(XEN_VERSION) (e.g. throughout a major release).
*/
+/* LIBXL_HAVE_GET_SET_LOG_LEVEL
+ *
+ * If this is defined libxl has a pair of APIs to get and set log levels
+ */
+#define LIBXL_HAVE_GET_SET_LOG_LEVEL 1
+
/* LIBXL_HAVE_VNUMA
*
* If this is defined the type libxl_vnode_info exists, and a
@@ -1951,6 +1957,11 @@ 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_log_level(libxl_ctx *ctx, bool guest,
+ char *lower_thresh, char *upper_thresh);
+int libxl_get_log_level(libxl_ctx *ctx, bool guest,
+ char *lower_thresh, unsigned int *lower_thresh_bufsize,
+ char *upper_thresh, unsigned int *upper_thresh_bufsize);
typedef struct libxl__xen_console_reader libxl_xen_console_reader;
Signed-off-by: Wei Liu <wei.liu2@citrix.com> --- Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Jan Beulich <JBeulich@suse.com> --- tools/libxl/libxl.c | 40 ++++++++++++++++++++++++++++++++++++++++ tools/libxl/libxl.h | 11 +++++++++++ 2 files changed, 51 insertions(+)