@@ -128,6 +128,12 @@ tools/libs/guest/xc_core.h
tools/libs/guest/xc_core_arm.h
tools/libs/guest/xc_core_x86.h
tools/libs/guest/xc_private.h
+tools/libs/store/headers.chk
+tools/libs/store/list.h
+tools/libs/store/utils.h
+tools/libs/store/xenstore.pc
+tools/libs/store/xs_lib.c
+tools/libs/store/include/xenstore_lib.h
tools/console/xenconsole
tools/console/xenconsoled
tools/console/client/_paths.h
@@ -282,7 +288,6 @@ tools/xenstore/xenstore-control
tools/xenstore/xenstore-ls
tools/xenstore/xenstored
tools/xenstore/xenstored_test
-tools/xenstore/xenstore.pc
tools/xenstore/xs_tdb_dump
tools/xentrace/xentrace_setsize
tools/xentrace/tbctl
@@ -5,7 +5,7 @@
# XEN_ROOT
# MINIOS_TARGET_ARCH
-XENSTORE_CPPFLAGS = -isystem $(XEN_ROOT)/tools/xenstore/include
+XENSTORE_CPPFLAGS = -isystem $(XEN_ROOT)/tools/libs/store/include
TOOLCORE_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toolcore
TOOLLOG_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog
EVTCHN_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn
@@ -43,7 +43,7 @@ SUBDIRS-y += pygrub
SUBDIRS-$(OCAML_TOOLS) += ocaml
ifeq ($(CONFIG_RUMP),y)
-SUBDIRS-y := libs xenstore
+SUBDIRS-y := libs
endif
# For the sake of linking, set the sys-root
@@ -18,7 +18,6 @@ include $(XEN_ROOT)/tools/libs/uselibs.mk
XEN_libxenlight = $(XEN_ROOT)/tools/libxl
# Currently libxlutil lives in the same directory as libxenlight
XEN_libxlutil = $(XEN_libxenlight)
-XEN_libxenstore = $(XEN_ROOT)/tools/xenstore
XEN_libxenstat = $(XEN_ROOT)/tools/xenstat/libxenstat/src
XEN_libxenvchan = $(XEN_ROOT)/tools/libvchan
@@ -106,10 +105,6 @@ $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_defs,$(lib))))
CFLAGS_libxenctrl += $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) -D__XEN_TOOLS__
CFLAGS_libxenguest += $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory)
-CFLAGS_libxenstore = -I$(XEN_libxenstore)/include $(CFLAGS_xeninclude)
-SHDEPS_libxenstore = $(SHLIB_libxentoolcore) $(SHLIB_libxenctrl)
-LDLIBS_libxenstore = $(SHDEPS_libxenstore) $(XEN_libxenstore)/libxenstore$(libextension)
-SHLIB_libxenstore = $(SHDEPS_libxenstore) -Wl,-rpath-link=$(XEN_libxenstore)
ifeq ($(CONFIG_Linux),y)
LDLIBS_libxenstore += -ldl
endif
@@ -12,6 +12,7 @@ SUBDIRS-y += devicemodel
SUBDIRS-y += ctrl
SUBDIRS-y += guest
SUBDIRS-y += hypfs
+SUBDIRS-y += store
ifeq ($(CONFIG_RUMP),y)
SUBDIRS-y := toolcore
new file mode 100644
@@ -0,0 +1,64 @@
+XEN_ROOT=$(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR = 3.0
+MINOR = 3
+
+ifeq ($(CONFIG_Linux),y)
+APPEND_LDFLAGS += -ldl
+endif
+
+SRCS-y += xs_lib.c
+SRCS-y += xs.c
+
+LIBHEADER = xenstore.h xenstore_lib.h
+
+include ../libs.mk
+
+# Include configure output (config.h)
+CFLAGS += -include $(XEN_ROOT)/tools/config.h
+CFLAGS += $(CFLAGS_libxentoolcore)
+CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\""
+CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\""
+
+LINK_FILES = xs_lib.c include/xenstore_lib.h list.h utils.h
+
+$(LIB_OBJS): $(LINK_FILES)
+
+$(LINK_FILES):
+ ln -sf $(XEN_ROOT)/tools/xenstore/$(notdir $@) $@
+
+xs.opic: CFLAGS += -DUSE_PTHREAD
+ifeq ($(CONFIG_Linux),y)
+xs.opic: CFLAGS += -DUSE_DLSYM
+else
+PKG_CONFIG_REMOVE += -ldl
+endif
+
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenstore)/include
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
+
+.PHONY: install
+install: install-headers
+
+.PHONY: install-headers
+install-headers:
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)/xenstore-compat
+ $(INSTALL_DATA) include/compat/xs.h $(DESTDIR)$(includedir)/xenstore-compat/xs.h
+ $(INSTALL_DATA) include/compat/xs_lib.h $(DESTDIR)$(includedir)/xenstore-compat/xs_lib.h
+ ln -sf xenstore-compat/xs.h $(DESTDIR)$(includedir)/xs.h
+ ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(includedir)/xs_lib.h
+
+.PHONY: uninstall
+uninstall: uninstall-headers
+
+.PHONY: uninstall-headers
+uninstall-headers:
+ rm -f $(DESTDIR)$(includedir)/xs_lib.h
+ rm -f $(DESTDIR)$(includedir)/xs.h
+ rm -f $(DESTDIR)$(includedir)/xenstore-compat/xs_lib.h
+ rm -f $(DESTDIR)$(includedir)/xenstore-compat/xs.h
+ if [ -d $(DESTDIR)$(includedir)/xenstore-compat ]; then \
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/xenstore-compat; \
+ fi
similarity index 100%
rename from tools/xenstore/include/compat/xs.h
rename to tools/libs/store/include/compat/xs.h
similarity index 100%
rename from tools/xenstore/include/compat/xs_lib.h
rename to tools/libs/store/include/compat/xs_lib.h
similarity index 100%
rename from tools/xenstore/include/xenstore.h
rename to tools/libs/store/include/xenstore.h
new file mode 100644
@@ -0,0 +1,49 @@
+VERS_3.0.3 {
+ global:
+ xs_open;
+ xs_close;
+ xs_daemon_open;
+ xs_domain_open;
+ xs_daemon_open_readonly;
+ xs_daemon_close;
+ xs_daemon_destroy_postfork;
+ xs_directory;
+ xs_read;
+ xs_write;
+ xs_mkdir;
+ xs_rm;
+ xs_restrict;
+ xs_get_permissions;
+ xs_set_permissions;
+ xs_watch;
+ xs_fileno;
+ xs_check_watch;
+ xs_read_watch;
+ xs_unwatch;
+ xs_transaction_start;
+ xs_transaction_end;
+ xs_introduce_domain;
+ xs_set_target;
+ xs_resume_domain;
+ xs_release_domain;
+ xs_get_domain_path;
+ xs_path_is_subpath;
+ xs_is_domain_introduced;
+ xs_control_command;
+ xs_debug_command;
+ xs_suspend_evtchn_port;
+ xs_daemon_rootdir;
+ xs_daemon_rundir;
+ xs_daemon_socket;
+ xs_daemon_socket_ro;
+ xs_domain_dev;
+ xs_daemon_tdb;
+ xs_write_all;
+ xs_strings_to_perms;
+ xs_perm_to_string;
+ xs_count_strings;
+ expanding_buffer_ensure;
+ sanitise_value;
+ unsanitise_value;
+ local: *; /* Do not expose anything by default */
+};
similarity index 100%
rename from tools/xenstore/xs.c
rename to tools/libs/store/xs.c
@@ -20,3 +20,5 @@ LIBS_LIBS += ctrl
USELIBS_ctrl := toollog call evtchn gnttab foreignmemory devicemodel
LIBS_LIBS += guest
USELIBS_guest := evtchn ctrl
+LIBS_LIBS += store
+USELIBS_store := toolcore
@@ -11,7 +11,7 @@ PATH_LIBXENTOOLLOG = XEN_ROOT + "/tools/libs/toollog"
PATH_LIBXENEVTCHN = XEN_ROOT + "/tools/libs/evtchn"
PATH_LIBXENCTRL = XEN_ROOT + "/tools/libs/ctrl"
PATH_LIBXL = XEN_ROOT + "/tools/libxl"
-PATH_XENSTORE = XEN_ROOT + "/tools/xenstore"
+PATH_XENSTORE = XEN_ROOT + "/tools/libs/store"
xc = Extension("xc",
extra_compile_args = extra_compile_args,
@@ -34,17 +34,7 @@ XENSTORED_OBJS_$(CONFIG_MiniOS) = xenstored_minios.o
XENSTORED_OBJS += $(XENSTORED_OBJS_y)
LDLIBS_xenstored += -lrt
-ifneq ($(XENSTORE_STATIC_CLIENTS),y)
-LIBXENSTORE := libxenstore.so
-else
-LIBXENSTORE := libxenstore.a
-xenstore xenstore-control: CFLAGS += -static
-endif
-
-ALL_TARGETS = libxenstore.a clients
-ifneq ($(nosharedlibs),y)
-ALL_TARGETS += libxenstore.so
-endif
+ALL_TARGETS = clients
ifeq ($(XENSTORE_XENSTORED),y)
ALL_TARGETS += xs_tdb_dump xenstored
endif
@@ -87,64 +77,21 @@ xenstored.a: $(XENSTORED_OBJS)
$(CLIENTS): xenstore
ln -f xenstore $@
-xenstore: xenstore_client.o $(LIBXENSTORE)
+xenstore: xenstore_client.o
$(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
-xenstore-control: xenstore_control.o $(LIBXENSTORE)
+xenstore-control: xenstore_control.o
$(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
$(CC) $^ $(LDFLAGS) -o $@ $(APPEND_LDFLAGS)
-libxenstore.so: libxenstore.so.$(MAJOR)
- ln -sf $< $@
-libxenstore.so.$(MAJOR): libxenstore.so.$(MAJOR).$(MINOR)
- ln -sf $< $@
-
-xs.opic: CFLAGS += -DUSE_PTHREAD
-ifeq ($(CONFIG_Linux),y)
-xs.opic: CFLAGS += -DUSE_DLSYM
-libxenstore.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += -ldl
-PKG_CONFIG_LIBSPRIV := -ldl
-endif
-
-libxenstore.so.$(MAJOR).$(MINOR): xs.opic xs_lib.opic
- $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenstore.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
-
-libxenstore.a: xs.o xs_lib.o
- $(AR) rcs $@ $^
-
-PKG_CONFIG := xenstore.pc
-PKG_CONFIG_NAME := Xenstore
-PKG_CONFIG_DESC := The Xenstore library for Xen hypervisor
-PKG_CONFIG_VERSION := $(MAJOR).$(MINOR)
-PKG_CONFIG_USELIBS := $(SHLIB_libxenstore)
-PKG_CONFIG_LIB := xenstore
-PKG_CONFIG_REQPRIV := xenevtchn,xencontrol,xengnttab,xentoolcore
-
-ifneq ($(CONFIG_LIBXC_MINIOS),y)
-PKG_CONFIG_INST := $(PKG_CONFIG)
-$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix)
-$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir)
-$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir)
-endif
-
-PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc))
-
-$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT)
-$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenstore)/include
-$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
-$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
-
-$(LIBXENSTORE): $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL)
-
.PHONY: clean
clean:
- rm -f *.a *.o *.opic *.so* xenstored_probes.h
+ rm -f *.a *.o xenstored_probes.h
rm -f xenstored xs_random xs_stress xs_crashme
rm -f xs_tdb_dump xenstore-control init-xenstore-domain
rm -f xenstore $(CLIENTS)
- rm -f xenstore.pc
$(RM) $(DEPS_RM)
.PHONY: distclean
@@ -161,8 +108,6 @@ tarball: clean
.PHONY: install
install: all
$(INSTALL_DIR) $(DESTDIR)$(bindir)
- $(INSTALL_DIR) $(DESTDIR)$(includedir)
- $(INSTALL_DIR) $(DESTDIR)$(includedir)/xenstore-compat
ifeq ($(XENSTORE_XENSTORED),y)
$(INSTALL_DIR) $(DESTDIR)$(sbindir)
$(INSTALL_DIR) $(DESTDIR)$(XEN_LIB_STORED)
@@ -173,32 +118,9 @@ endif
set -e ; for c in $(CLIENTS) ; do \
ln -f $(DESTDIR)$(bindir)/xenstore $(DESTDIR)$(bindir)/$${c} ; \
done
- $(INSTALL_DIR) $(DESTDIR)$(libdir)
- $(INSTALL_SHLIB) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
- ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenstore.so.$(MAJOR)
- ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenstore.so
- $(INSTALL_DATA) libxenstore.a $(DESTDIR)$(libdir)
- $(INSTALL_DATA) include/xenstore.h $(DESTDIR)$(includedir)
- $(INSTALL_DATA) include/xenstore_lib.h $(DESTDIR)$(includedir)
- $(INSTALL_DATA) include/compat/xs.h $(DESTDIR)$(includedir)/xenstore-compat/xs.h
- $(INSTALL_DATA) include/compat/xs_lib.h $(DESTDIR)$(includedir)/xenstore-compat/xs_lib.h
- ln -sf xenstore-compat/xs.h $(DESTDIR)$(includedir)/xs.h
- ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(includedir)/xs_lib.h
- $(INSTALL_DATA) xenstore.pc $(DESTDIR)$(PKG_INSTALLDIR)
.PHONY: uninstall
uninstall:
- rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xenstore.pc
- rm -f $(DESTDIR)$(includedir)/xs_lib.h
- rm -f $(DESTDIR)$(includedir)/xs.h
- rm -f $(DESTDIR)$(includedir)/xenstore-compat/xs_lib.h
- rm -f $(DESTDIR)$(includedir)/xenstore-compat/xs.h
- rm -f $(DESTDIR)$(includedir)/xenstore_lib.h
- rm -f $(DESTDIR)$(includedir)/xenstore.h
- rm -f $(DESTDIR)$(libdir)/libxenstore.a
- rm -f $(DESTDIR)$(libdir)/libxenstore.so
- rm -f $(DESTDIR)$(libdir)/libxenstore.so.$(MAJOR)
- rm -f $(DESTDIR)$(libdir)/libxenstore.so.$(MAJOR).$(MINOR)
rm -f $(addprefix $(DESTDIR)$(bindir)/, $(CLIENTS))
rm -f $(DESTDIR)$(bindir)/xenstore
rm -f $(DESTDIR)$(bindir)/xenstore-control
similarity index 100%
rename from tools/xenstore/include/xenstore_lib.h
rename to tools/xenstore/xenstore_lib.h