Skip to contentSkip to conversation

integrate xen-ocaml-tools.hg with xen-unstable.hg - select xenstored source

PATCH In review Alex Zeffertt 1 participant 1 message Apr 24, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 integrate xen-ocaml-tools.hg with xen-unstable.hg - select xenstored source

Provide option of using xen-ocaml-tools.hg as source for xenstored dom0 deamon instead of tools/xenstore/xenstored_*.

To use, create a .config containing "CONFIG_OCAML_XENSTORED := y". Then the build system will automatically download the remote repo to tools/ocaml-xenstored.

Note: this patch depends on the xen-ocaml-tools.hg patch called install-xenstored-in-usr-sbin, which was previously posted.

.hgignore +2 -0
diff -r 3c64c820d601 .hgignore
@@ -90,6 +90,7 @@
 ^stubdom/gcc-.*$
 ^stubdom/include$
 ^stubdom/ioemu$
+^stubdom/xenstore$
 ^stubdom/libxc-.*$
 ^stubdom/lwip-.*$
 ^stubdom/mini-os-.*$
@@ -252,6 +253,7 @@
 ^tools/xm-test/tests/.*\.test$
 ^tools/ioemu-remote
 ^tools/ioemu-dir$
+^tools/ocaml-xenstored
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
Config.mk +6 -0
diff -r 3c64c820d601 Config.mk
@@ -119,6 +119,12 @@
 # CONFIG_QEMU ?= ../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
+OCAML_XENSTORED_REPO=http://xenbits.xensource.com/ext/xen-ocaml-tools.hg
+
+# Uncomment to build OCAML version of xenstored instead of the in-tree
+# C version.  This will cause $(OCAML_XENSTORED_REPO) to be cloned
+#CONFIG_OCAML_XENSTORED ?= y
+
 # Optional components
 XENSTAT_XENTOP     ?= y
 VTPM_TOOLS         ?= n
tools/Makefile +24 -0
diff -r 3c64c820d601 tools/Makefile
@@ -6,6 +6,9 @@
 SUBDIRS-y += include
 SUBDIRS-y += libxc
 SUBDIRS-y += flask
+ifeq ($(CONFIG_OCAML_XENSTORED),y)
+ SUBDIRS-y += ocaml-xenstored
+endif
 SUBDIRS-y += xenstore
 SUBDIRS-y += misc
 SUBDIRS-y += examples
@@ -49,6 +52,7 @@
 	$(INSTALL_DIR) $(DESTDIR)/var/xen/dump
 	$(INSTALL_DIR) $(DESTDIR)/var/log/xen
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen
+	$(INSTALL_DIR) $(DESTDIR)/var/lock/subsys
 
 .PHONY: clean distclean
 clean distclean: subdirs-clean
@@ -101,3 +105,23 @@
 		$(absolutify_xen_root); \
 		$(MAKE) -C ioemu-dir clean; \
 	fi
+
+ocaml-xenstored:
+	set -ex; \
+	rm -rf ocaml-xenstored.tmp; \
+	hg clone $(OCAML_XENSTORED_REPO) ocaml-xenstored.tmp; \
+	if [ "$(OCAML_XENSTORED_TAG)" ]; then \
+		hg -R ocaml-xenstored.tmp update -r $(OCAML_XENSTORED_TAG) ;\
+		hg -R ocaml-xenstored.tmp branch mybranch ;\
+	fi;						\
+	mv ocaml-xenstored.tmp ocaml-xenstored; \
+
+subdir-all-ocaml-xenstored subdir-install-ocaml-xenstored: ocaml-xenstored
+	$(absolutify_xen_root); \
+	$(MAKE) -C ocaml-xenstored $(patsubst subdir-%-ocaml-xenstored,%,$@);
+
+subdir-clean-ocaml-xenstored:
+	set -e; if test -d ocaml-xenstored; then \
+		$(MAKE) -C ocaml-xenstored clean; \
+	fi
+
tools/xenstore/Makefile +9 -2
diff -r 3c64c820d601 tools/xenstore/Makefile
@@ -30,8 +30,13 @@
 CFLAGS += -DNO_SOCKETS=1 -DNO_LOCAL_XENBUS=1 -DNO_SYSLOG=1 -DNO_REOPEN_LOG=1
 endif
 
+ALL_TARGETS = libxenstore.so libxenstore.a clients xs_tdb_dump 
+ifeq ($(CONFIG_OCAML_XENSTORED),)
+ ALL_TARGETS += xenstored
+endif
+
 .PHONY: all
-all: libxenstore.so libxenstore.a xenstored clients xs_tdb_dump 
+all: $(ALL_TARGETS)
 
 .PHONY: clients
 clients: xenstore $(CLIENTS) xenstore-control
@@ -97,12 +102,14 @@
 
 .PHONY: install
 install: all
+ifeq ($(CONFIG_OCAML_XENSTORED),)
 	$(INSTALL_DIR) $(DESTDIR)/var/run/xenstored
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
+	$(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
+endif
 	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
 	$(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
 	$(INSTALL_PROG) xenstore $(DESTDIR)$(BINDIR)
 	set -e ; for c in $(CLIENTS) ; do \

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel