Skip to contentSkip to conversation

build: Don't fetch tools/ioemu-dir unless needed

PATCH Superseded George Dunlap 2 participants 2 messages May 6, 2011 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: Don't fetch tools/ioemu-dir unless needed

c/s 18482 made both stubdom and tools dependent on tools/ioemu-dir to fix a race condition where both build paths might try to fetch qemu in parallel. But this means that even if you build the tools with CONFIG_IOEMU=n, qemu is still fetched first.

This patch causes tools/ioemu-dir to be a dependency for tools only if CONFIG_IOEMU is enabled.

It's still unconditional for stubdoms, as it doesn't make much sense to build stubdoms without it.

Config.mk +5 -0
diff -r 4b0692880dfa -r c3b9bca4b119 Config.mk
@@ -179,6 +179,11 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
+# If building with CONFIG_IOEMU, get ioemu-dir before building
+# tools or stubdom (or they may race)
+SHARED_SUBDIRS-y :=
+SHARED_SUBDIRS-$(CONFIG_IOEMU) += tools/ioemu-dir
+
 QEMU_TAG := xen-4.1.0-rc6
 #QEMU_TAG ?= e073e69457b4d99b6da0b6536296e3498f7f6599
 # Fri Feb 11 17:54:51 2011 +0000
Makefile +2 -1
diff -r 4b0692880dfa -r c3b9bca4b119 Makefile
@@ -66,7 +66,7 @@
 	$(MAKE) -C xen install
 
 .PHONY: install-tools
-install-tools: tools/ioemu-dir
+install-tools: $(SHARED_SUBDIRS-y)
 	$(MAKE) -C tools install
 
 .PHONY: install-kernels
@@ -74,6 +74,7 @@
 	for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done
 
 .PHONY: install-stubdom
+# NB: depend on tools/ioemu-dir unconditionally for stubdoms
 install-stubdom: tools/ioemu-dir install-tools
 	$(MAKE) -C stubdom install
 ifeq (x86_64,$(XEN_TARGET_ARCH))
#1 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line · George Dunlap

c/s 18482 made both stubdom and tools dependent on tools/ioemu-dir to fix a race condition where both build paths might try to fetch qemu in parallel. But this means that even if you build the tools with CONFIG_IOEMU=n, qemu is still fetched first.

This patch causes tools/ioemu-dir to be a dependency for tools only if CONFIG_IOEMU is enabled.

It's still unconditional for stubdoms, as it doesn't make much sense to build stubdoms without it.

The idea is certainly good, but ...

Config.mk line 185

Quoted 13 lines

diff -r 4b0692880dfa -r c3b9bca4b119 Config.mk

Config.mk +4 -0
@@ -179,6 +179,11 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
+# If building with CONFIG_IOEMU, get ioemu-dir before building
+# tools or stubdom (or they may race)
+SHARED_SUBDIRS-y :=
+SHARED_SUBDIRS-$(CONFIG_IOEMU) += tools/ioemu-dir

... the name chosen here isn't really suitable for the place you put
it: Either the name should be sufficiently distinct, or this should be placed in ./Makefile (though even then I'd probably still like to see it somehow specify what or by whom this is shared). Otherwise, if something becomes shared e.g. between Xen and tools, it would be logical to expect to simply put it here, but obviously this won't work then.

Jan

Quoted 29 lines
Config.mk +1 -0
+
 QEMU_TAG := xen-4.1.0-rc6
 #QEMU_TAG ?= e073e69457b4d99b6da0b6536296e3498f7f6599
 # Fri Feb 11 17:54:51 2011 +0000

diff -r 4b0692880dfa -r c3b9bca4b119 Makefile

Makefile +2 -1
@@ -66,7 +66,7 @@
 	$(MAKE) -C xen install
 
 .PHONY: install-tools
-install-tools: tools/ioemu-dir
+install-tools: $(SHARED_SUBDIRS-y)
 	$(MAKE) -C tools install
 
 .PHONY: install-kernels
@@ -74,6 +74,7 @@
 	for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done
 
 .PHONY: install-stubdom
+# NB: depend on tools/ioemu-dir unconditionally for stubdoms
 install-stubdom: tools/ioemu-dir install-tools
 	$(MAKE) -C stubdom install
 ifeq (x86_64,$(XEN_TARGET_ARCH))

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