From: Ian Jackson Date: Tue, 8 Jul 2008 16:04:06 +0000 (+0100) Subject: Build system fixes for integration with xen-unstable X-Git-Tag: xen-3.3.0-rc1~52 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5650b8ce524cd11a2a2c24068931681a53926f37;p=qemu-xen-3.3-testing.git Build system fixes for integration with xen-unstable * qemu-dm goes in /usr/$(LIBLEAFDIR)/xen/bin * install qemu-ifup (copied from xen-unstable tip 17987:9b35ae586cb8) in /etc/xen --- diff --git a/Makefile.target b/Makefile.target index 39e72bc0..cea4def8 100644 --- a/Makefile.target +++ b/Makefile.target @@ -292,6 +292,7 @@ OPC_H = gen-op.h dyngen-opc.h op.h endif -include hookslib.mak +-include hookstarget.mak libqemu.a: $(LIBOBJS) rm -f $@ @@ -701,7 +702,7 @@ clean: rm -f *.o *.a *~ $(PROGS) gen-op.h dyngen-opc.h op.h nwfpe/*.o fpu/*.o rm -f *.d */*.d tcg/*.o -install: all +install: all install-hook ifneq ($(PROGS),) $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)" endif diff --git a/i386-dm/hookstarget.mak b/i386-dm/hookstarget.mak new file mode 100644 index 00000000..cf4b39eb --- /dev/null +++ b/i386-dm/hookstarget.mak @@ -0,0 +1,5 @@ + +install-hook: + $(INSTALL_DIR) "$(DESTDIR)/$(bindir)" + $(INSTALL_DIR) "$(DESTDIR)/$(configdir)" + $(INSTALL_PROG) qemu-ifup "$(DESTDIR)/$(configdir)/" diff --git a/i386-dm/qemu-ifup b/i386-dm/qemu-ifup new file mode 100644 index 00000000..bcbee92d --- /dev/null +++ b/i386-dm/qemu-ifup @@ -0,0 +1,37 @@ +#!/bin/sh + +#. /etc/rc.d/init.d/functions +#ulimit -c unlimited + +echo 'config qemu network with xen bridge for ' $* + +bridge=$2 + +# +# Old style bridge setup with netloop, used to have a bridge name +# of xenbrX, enslaving pethX and vif0.X, and then configuring +# eth0. +# +# New style bridge setup does not use netloop, so the bridge name +# is ethX and the physical device is enslaved pethX +# +# So if... +# +# - User asks for xenbrX +# - AND xenbrX doesn't exist +# - AND there is a ethX device which is a bridge +# +# ..then we translate xenbrX to ethX +# +# This lets old config files work without modification +# +if [ ! -e "/sys/class/net/$bridge" ] && [ -z "${bridge##xenbr*}" ] +then + if [ -e "/sys/class/net/eth${bridge#xenbr}/bridge" ] + then + bridge="eth${bridge#xenbr}" + fi +fi + +ifconfig $1 0.0.0.0 up +brctl addif $bridge $1 || true diff --git a/xen-config.mak b/xen-config.mak index 256bcef0..62106191 100644 --- a/xen-config.mak +++ b/xen-config.mak @@ -7,3 +7,5 @@ TARGET_ARCH=i386 CONFIG_SOFTMMU=yes CFLAGS += -I$(QEMU_ROOT)/hw + +bindir = ${prefix}/${LIBLEAFDIR}/xen/bin diff --git a/xen-hooks.mak b/xen-hooks.mak index 4962ac29..918d9c0c 100644 --- a/xen-hooks.mak +++ b/xen-hooks.mak @@ -55,3 +55,5 @@ EXESUF=-xen datadir := $(subst qemu,xen/qemu,$(datadir)) docdir := $(subst qemu,xen/qemu,$(docdir)) mandir := $(subst share/man,share/xen/man,$(mandir)) + +configdir := /etc/xen