This is because libxl uses XEN_RUN_DIR to generate the socket path for
libxenstat while libxenstat itself uses hard-coded path, which is not
necessarily the same path as XEN_RUN_DIR. The default configuration
happened to work because XEN_RUN_DIR defaulted to /var/run/xen, which
matched the hard-coded path.
We should make libxenstat use XEN_RUN_DIR so that it works with
non-default configuration.
Generate a _paths.h because it is required to make this change work.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
(cherry picked from commit
dedb221889dbdd96f1d3c1155c3eb492d329bb53)
tools/xenmon/xenbaked
tools/xenpaging/xenpaging
tools/xenpmd/xenpmd
+tools/xenstat/libxenstat/src/_paths.h
tools/xenstat/xentop/xentop
tools/xenstore/xenstore
tools/xenstore/xenstore-chmod
.PHONY: all
all: $(LIB) $(SHLIB) $(SHLIB_LINKS)
+$(OBJECTS-y): src/_paths.h
+
$(LIB): $(OBJECTS-y)
$(AR) rc $@ $^
$(RANLIB) $@
.PHONY: clean
clean:
rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \
- $(BINDINGS) $(BINDINGSRC) $(DEPS)
+ $(BINDINGS) $(BINDINGSRC) $(DEPS) src/_paths.h
.PHONY: distclean
distclean: clean
-include $(DEPS)
+
+genpath-target = $(call buildmakevars2header,src/_paths.h)
+$(eval $(genpath-target))
#include <xenctrl.h>
#include "xenstat_priv.h"
+#include "_paths.h"
#ifdef HAVE_YAJL_YAJL_VERSION_H
# include <yajl/yajl_version.h>
free(val);
/* Connect to this VMs QMP socket */
- snprintf(path, sizeof(path), "/var/run/xen/qmp-libxenstat-%i", domain);
+ snprintf(path, sizeof(path), XEN_RUN_DIR "/qmp-libxenstat-%i", domain);
if ((qfd = qmp_connect(path)) < 0)
return;