mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/xl: add available Xenstore features to xl info output
Add the Xenstore feature value to the output of "xl info" in order to prepare for a future capability to limit Xenstore features visible by a guest. Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com> Acked-by: Anthony PERARD <anthony.perard@vates.tech>
This commit is contained in:
1 parent
dfabb3fee3
commit
ecce7970cf
2 files changed
+24
-1
No files matched your search
+2
-1
@@ -13,6 +13,7 @@ LDFLAGS += $(PTHREAD_LDFLAGS)
|
||||
|
||||
CFLAGS_XL += $(CFLAGS_libxenlight)
|
||||
CFLAGS_XL += $(CFLAGS_libxenutil)
|
||||
CFLAGS_XL += $(CFLAGS_libxenstore)
|
||||
CFLAGS_XL += -Wshadow
|
||||
|
||||
XL_OBJS-$(CONFIG_X86) = xl_psr.o
|
||||
@@ -32,7 +33,7 @@ $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs i
|
||||
all: xl
|
||||
|
||||
xl: $(XL_OBJS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxenutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxenutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) -lyajl $(APPEND_LDFLAGS)
|
||||
|
||||
.PHONY: install
|
||||
install: all
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <libxl_utils.h>
|
||||
#include <libxlutil.h>
|
||||
#include <xen-tools/arm-arch-capabilities.h>
|
||||
#include <xenstore.h>
|
||||
|
||||
#include "xl.h"
|
||||
#include "xl_utils.h"
|
||||
@@ -333,6 +334,25 @@ static void output_topologyinfo(void)
|
||||
return;
|
||||
}
|
||||
|
||||
static void output_xenstore_info(void)
|
||||
{
|
||||
struct xs_handle *xsh;
|
||||
unsigned int features = 0;
|
||||
|
||||
xsh = xs_open(0);
|
||||
if (!xsh) {
|
||||
fprintf(stderr, "xs_open failed.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Ignore error, default to "0" for features. */
|
||||
xs_get_features_supported(xsh, &features);
|
||||
|
||||
maybe_printf("xenstore_features : 0x%08x\n", features);
|
||||
|
||||
xs_close(xsh);
|
||||
}
|
||||
|
||||
static void print_info(int numa)
|
||||
{
|
||||
output_nodeinfo();
|
||||
@@ -345,6 +365,8 @@ static void print_info(int numa)
|
||||
}
|
||||
output_xeninfo();
|
||||
|
||||
output_xenstore_info();
|
||||
|
||||
maybe_printf("xend_config_format : 4\n");
|
||||
|
||||
return;
|
||||
|
||||