Skip to contentSkip to conversation

Introduce support for upstream qemu in the xen-unstable build system

PATCH In review [email protected] 3 participants 6 messages Sep 7, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Introduce support for upstream qemu in the xen-unstable build system

In order to distinguish between upstream qemu and qemu-xen I am introducing a new variable named "QEMU" that only if is equal to "upstream" switches the build system to the new qemu.

Users that want to try the new qemu just have to export QEMU=upstream before calling make in the xen-unstable top level directory.

Config.mk +10 -1
diff -r 0ba816e077e6 Config.mk
@@ -192,12 +192,21 @@ else
 QEMU_REMOTE=git://xenbits.xensource.com/qemu-xen-unstable.git
 endif
 
+# Only available through the git protocol at the moment
+QEMU_UPSTREAM_URL=git://xenbits.xen.org/people/sstabellini/qemu-dm.git
+QEMU_UPSTREAM_TAG=origin/xen-stable-0.15
+
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
+ifeq ($(QEMU),upstream)
+CONFIG_QEMU ?= $(QEMU_UPSTREAM_URL)
+QEMU_TAG ?= $(QEMU_UPSTREAM_TAG)
+else
 CONFIG_QEMU ?= $(QEMU_REMOTE)
+QEMU_TAG ?= cd776ee9408ff127f934a707c1a339ee600bc127
+endif
 
-QEMU_TAG ?= cd776ee9408ff127f934a707c1a339ee600bc127
 # Tue Jun 28 13:50:53 2011 +0100
 # qemu-char.c: fix incorrect CONFIG_STUBDOM handling
 
tools/Makefile +13 -1
diff -r 0ba816e077e6 tools/Makefile
@@ -106,7 +106,19 @@ ioemu-dir-find:
 	set -e; \
 		$(buildmakevars2shellvars); \
 		cd ioemu-dir; \
-		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS)
+		if [ "$(QEMU)" = upstream ]; then \
+			cd $(QEMU_ROOT); \
+			./configure --enable-xen --target-list=i386-softmmu \
+			--extra-cflags="-I$(XEN_ROOT)/tools/include \
+			-I$(XEN_ROOT)/tools/libxc \
+			-I$(XEN_ROOT)/tools/xenstore" \
+			--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
+			-L$(XEN_ROOT)/tools/libxenstore" \
+			--disable-kvm \
+			$(IOEMU_CONFIGURE_CROSS); \
+		else \
+			$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
+		fi
 
 .PHONY: ioemu-dir-force-update
 ioemu-dir-force-update:
#1 lore raw

PATCH 2/2 Automatically select seabios when we are building upstream qemu

Config.mk +4 -9
diff -r f1269b3216ef Config.mk
@@ -195,6 +195,7 @@ endif
 # Only available through the git protocol at the moment
 QEMU_UPSTREAM_URL=git://xenbits.xen.org/people/sstabellini/qemu-dm.git
 QEMU_UPSTREAM_TAG=origin/xen-stable-0.15
+SEABIOS_UPSTREAM_URL=git://git.qemu.org/seabios.git
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
@@ -202,9 +203,12 @@ QEMU_UPSTREAM_TAG=origin/xen-stable-0.15
 ifeq ($(QEMU),upstream)
 CONFIG_QEMU ?= $(QEMU_UPSTREAM_URL)
 QEMU_TAG ?= $(QEMU_UPSTREAM_TAG)
+CONFIG_SEABIOS ?= $(SEABIOS_UPSTREAM_URL)
+SEABIOS_TAG ?= 7fc039e9c262b4199fab497f3e12f4e425c37560
 else
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 QEMU_TAG ?= cd776ee9408ff127f934a707c1a339ee600bc127
+CONFIG_SEABIOS ?=
 endif
 
 # Tue Jun 28 13:50:53 2011 +0100
@@ -213,15 +217,6 @@ endif
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
 
-# SeaBIOS integration is a work in progress. Before enabling this
-# option you must clone git://git.qemu.org/seabios.git/, possibly add
-# some development patches and then build it yourself before pointing
-# this variable to it (using an absolute path).
-#
-# Note that using SeaBIOS requires the use the upstream qemu as the
-# device model.
-SEABIOS_DIR ?= 
-
 # Optional components
 XENSTAT_XENTOP     ?= y
 VTPM_TOOLS         ?= n
tools/firmware/Makefile +27 -2
diff -r f1269b3216ef tools/firmware/Makefile
@@ -6,13 +6,35 @@ TARGET      := hvmloader/hvmloader
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
 SUBDIRS :=
+ifneq ($(CONFIG_SEABIOS),)
+SEABIOS_DIR := seabios-dir
+SUBDIRS += $(SEABIOS_DIR)
+endif
 SUBDIRS += rombios
 SUBDIRS += vgabios
 SUBDIRS += etherboot
 SUBDIRS += hvmloader
 
+$(SEABIOS_DIR):
+	set -ex; \
+	if [ ! -d seabios-remote ]; then \
+		rm -rf seabios-remote seabios-remote.tmp; \
+		mkdir seabios-remote.tmp; rmdir seabios-remote.tmp; \
+		$(GIT) clone $(CONFIG_SEABIOS) seabios-remote.tmp; \
+		if [ "$(SEABIOS_TAG)" ]; then			\
+			cd seabios-remote.tmp;			\
+			$(GIT) branch -D dummy >/dev/null 2>&1 ||:; \
+			$(GIT) checkout -b dummy $(SEABIOS_TAG);	\
+			cd ..;					\
+		fi;						\
+		mv seabios-remote.tmp seabios-remote; \
+	fi; \
+	rm -f seabios-dir; \
+	ln -sf seabios-remote seabios-dir; \
+	mv seabios-config seabios-dir/.config;
+
 .PHONY: all
-all:
+all: $(SEABIOS_DIR)
 	@set -e; if [ $$((`( bcc -v 2>&1 | grep version || echo 0.0.0 ) | cut -d' ' -f 3 | awk -F. '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -lt $$((0x00100e)) ] ; then \
 	echo "==========================================================================="; \
 	echo "Require dev86 rpm or bin86 & bcc debs version >= 0.16.14 to build firmware!"; \
@@ -35,4 +57,7 @@ clean: subdirs-clean
 distclean: subdirs-distclean
 
 subdir-distclean-etherboot: .phony
-	$(MAKE) -C etherboot distclean
\ No newline at end of file
+	$(MAKE) -C etherboot distclean
+
+subdir-distclean-$(SEABIOS_DIR): .phony
+	rm -rf seabios-dir seabios-remote
tools/firmware/hvmloader/Makefile +5 -7
diff -r f1269b3216ef tools/firmware/hvmloader/Makefile
@@ -37,19 +37,17 @@ endif
 
 CIRRUSVGA_DEBUG ?= n
 
+ifneq ($(SEABIOS_DIR),)
+OBJS += seabios.o
+CFLAGS += -DENABLE_SEABIOS
+SEABIOS_ROM := ../$(SEABIOS_DIR)/out/bios.bin
+else
 ROMBIOS_DIR := ../rombios
-ifneq ($(ROMBIOS_DIR),)
 OBJS += rombios.o
 CFLAGS += -DENABLE_ROMBIOS
 ROMBIOS_ROM := $(ROMBIOS_DIR)/BIOS-bochs-latest
 endif
 
-ifneq ($(SEABIOS_DIR),)
-OBJS += seabios.o
-CFLAGS += -DENABLE_SEABIOS
-SEABIOS_ROM := $(SEABIOS_DIR)/out/bios.bin
-endif
-
 STDVGA_ROM    := ../vgabios/VGABIOS-lgpl-latest.bin
 ifeq ($(CIRRUSVGA_DEBUG),y)
 CIRRUSVGA_ROM := ../vgabios/VGABIOS-lgpl-latest.cirrus.debug.bin
tools/firmware/seabios-config new file +73 -0

73 lines not on this page · raw message

#2 lore raw
In reply to [email protected]
Quoted 3 lines · On Wed, 2011-09-07 at 10:39 -0400, [email protected] wrote:

In order to distinguish between upstream qemu and qemu-xen I am introducing a new variable named "QEMU" that only if is equal to "upstream" switches the build system to the new qemu.

Thanks Stefano, this integrated support is overdue.

Ultimately though I expect we will need a "both" mode since people will want old qemu for compatibility with their existing installed guests and new qemu for new ones. The allegation (and I don't really know how true it is or if it is pessimism or realism) is that some OSes don't cope with having the platform components etc changed under them.

Quoted 2 lines

Users that want to try the new qemu just have to export QEMU=upstream before calling make in the xen-unstable top level directory.

In xl/libxl we call them "qemu-xen-traditional" and "qemu-xen". Perhaps we should mirror that nomenclature here?

Quoted 58 lines

diff -r 0ba816e077e6 Config.mk

Config.mk +10 -1
@@ -192,12 +192,21 @@ else
 QEMU_REMOTE=git://xenbits.xensource.com/qemu-xen-unstable.git
 endif
 
+# Only available through the git protocol at the moment
+QEMU_UPSTREAM_URL=git://xenbits.xen.org/people/sstabellini/qemu-dm.git
+QEMU_UPSTREAM_TAG=origin/xen-stable-0.15
+
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
+ifeq ($(QEMU),upstream)
+CONFIG_QEMU ?= $(QEMU_UPSTREAM_URL)
+QEMU_TAG ?= $(QEMU_UPSTREAM_TAG)
+else
 CONFIG_QEMU ?= $(QEMU_REMOTE)
+QEMU_TAG ?= cd776ee9408ff127f934a707c1a339ee600bc127
+endif
 
-QEMU_TAG ?= cd776ee9408ff127f934a707c1a339ee600bc127
 # Tue Jun 28 13:50:53 2011 +0100
 # qemu-char.c: fix incorrect CONFIG_STUBDOM handling
 

diff -r 0ba816e077e6 tools/Makefile

tools/Makefile +13 -1
@@ -106,7 +106,19 @@ ioemu-dir-find:
 	set -e; \
 		$(buildmakevars2shellvars); \
 		cd ioemu-dir; \
-		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS)
+		if [ "$(QEMU)" = upstream ]; then \
+			cd $(QEMU_ROOT); \
+			./configure --enable-xen --target-list=i386-softmmu \
+			--extra-cflags="-I$(XEN_ROOT)/tools/include \
+			-I$(XEN_ROOT)/tools/libxc \
+			-I$(XEN_ROOT)/tools/xenstore" \
+			--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
+			-L$(XEN_ROOT)/tools/libxenstore" \
+			--disable-kvm \
+			$(IOEMU_CONFIGURE_CROSS); \
+		else \
+			$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
+		fi
 
 .PHONY: ioemu-dir-force-update
 ioemu-dir-force-update:

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

#3 lore raw
Quoted 6 lines · Ian Campbell
Quoted 3 lines · On Wed, 2011-09-07 at 10:39 -0400, [email protected] wrote:

In order to distinguish between upstream qemu and qemu-xen I am introducing a new variable named "QEMU" that only if is equal to "upstream" switches the build system to the new qemu.

Quoted 7 lines

Thanks Stefano, this integrated support is overdue.

Ultimately though I expect we will need a "both" mode since people will want old qemu for compatibility with their existing installed guests and new qemu for new ones. The allegation (and I don't really know how true it is or if it is pessimism or realism) is that some OSes don't cope with having the platform components etc changed under them.

Yes. At that point we'll probably have to always build them both, including two hvmloader...

Quoted 5 lines
Quoted 2 lines

Users that want to try the new qemu just have to export QEMU=upstream before calling make in the xen-unstable top level directory.

In xl/libxl we call them "qemu-xen-traditional" and "qemu-xen". Perhaps we should mirror that nomenclature here?

I looked at libxl but I thought that QEMU=qemu-xen would be confusing for users/developers.
Like you said, considering that we already have device_model_version=qemu-xen in VM config files, maybe we should go for DEVICE_MODEL=qemu-xen?

#4 lore raw
Quoted 9 lines · Stefano Stabellini
Quoted 8 lines · Ian Campbell
Quoted 3 lines · On Wed, 2011-09-07 at 10:39 -0400, [email protected] wrote:

In order to distinguish between upstream qemu and qemu-xen I am introducing a new variable named "QEMU" that only if is equal to "upstream" switches the build system to the new qemu.

Thanks Stefano, this integrated support is overdue.

Quoted 7 lines
Quoted 5 lines

Ultimately though I expect we will need a "both" mode since people will want old qemu for compatibility with their existing installed guests and new qemu for new ones. The allegation (and I don't really know how true it is or if it is pessimism or realism) is that some OSes don't cope with having the platform components etc changed under them.

Yes. At that point we'll probably have to always build them both,

Why wait? Why not just do that now.

Quoted 1 line

including two hvmloader...

Only one hvmloader will be needed, it will include both rombios and seabios support and it selects the right one at boot time, since the toolstack pushes down the choice. This is what happens today if you turn on the SEABIOS option.

Quoted 11 lines
Quoted 5 lines
Quoted 2 lines

Users that want to try the new qemu just have to export QEMU=upstream before calling make in the xen-unstable top level directory.

In xl/libxl we call them "qemu-xen-traditional" and "qemu-xen". Perhaps we should mirror that nomenclature here?

I looked at libxl but I thought that QEMU=qemu-xen would be confusing for users/developers.
Like you said, considering that we already have device_model_version=qemu-xen in VM config files, maybe we should go for DEVICE_MODEL=qemu-xen?

With the (current) default being DEVICE_MODEL=qemu-xen-traditional? That would makes sense to me (excepting that, as above, I think we shouldn't offer it as a choice in the first place).

Ian.

#5 lore raw
In reply to [email protected]
Quoted 6 lines · On 07/09/2011 15:39, "[email protected]"…

In order to distinguish between upstream qemu and qemu-xen I am introducing a new variable named "QEMU" that only if is equal to "upstream" switches the build system to the new qemu.

Users that want to try the new qemu just have to export QEMU=upstream before calling make in the xen-unstable top level directory.

I think we should build and install both, and select between them via per-domain config option. That's basically what we need for supporting old save images.

-- Keir

Quoted 52 lines

diff -r 0ba816e077e6 Config.mk

Config.mk Wed Sep 07 11:13:17 2011 +0000 renamed from Config.mk Wed Aug 31 16:04:37 2011 +0000 +10 -1
@@ -192,12 +192,21 @@ else
 QEMU_REMOTE=git://xenbits.xensource.com/qemu-xen-unstable.git
 endif
 
+# Only available through the git protocol at the moment
+QEMU_UPSTREAM_URL=git://xenbits.xen.org/people/sstabellini/qemu-dm.git
+QEMU_UPSTREAM_TAG=origin/xen-stable-0.15
+
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
+ifeq ($(QEMU),upstream)
+CONFIG_QEMU ?= $(QEMU_UPSTREAM_URL)
+QEMU_TAG ?= $(QEMU_UPSTREAM_TAG)
+else
 CONFIG_QEMU ?= $(QEMU_REMOTE)
+QEMU_TAG ?= cd776ee9408ff127f934a707c1a339ee600bc127
+endif
 
-QEMU_TAG ?= cd776ee9408ff127f934a707c1a339ee600bc127
 # Tue Jun 28 13:50:53 2011 +0100
 # qemu-char.c: fix incorrect CONFIG_STUBDOM handling
 

diff -r 0ba816e077e6 tools/Makefile

tools/Makefile Wed Sep 07 11:13:17 2011 +0000 renamed from tools/Makefile Wed Aug 31 16:04:37 2011 +0000 +13 -1
@@ -106,7 +106,19 @@ ioemu-dir-find:
 set -e; \
 $(buildmakevars2shellvars); \
 cd ioemu-dir; \
-  $(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS)
+  if [ "$(QEMU)" = upstream ]; then \
+   cd $(QEMU_ROOT); \
+   ./configure --enable-xen --target-list=i386-softmmu \
+   --extra-cflags="-I$(XEN_ROOT)/tools/include \
+   -I$(XEN_ROOT)/tools/libxc \
+   -I$(XEN_ROOT)/tools/xenstore" \
+   --extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
+   -L$(XEN_ROOT)/tools/libxenstore" \
+   --disable-kvm \
+   $(IOEMU_CONFIGURE_CROSS); \
+  else \
+   $(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
+  fi
 
 .PHONY: ioemu-dir-force-update
 ioemu-dir-force-update: