]> xenbits.xensource.com Git - qemu-xen-3.3-testing.git/commitdiff
Build system fixes for integration with xen-unstable
authorIan Jackson <iwj@mariner.uk.xensource.com>
Tue, 8 Jul 2008 16:04:06 +0000 (17:04 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 8 Jul 2008 16:04:06 +0000 (17:04 +0100)
* qemu-dm goes in /usr/$(LIBLEAFDIR)/xen/bin
* install qemu-ifup (copied from xen-unstable tip 17987:9b35ae586cb8)
  in /etc/xen

Makefile.target
i386-dm/hookstarget.mak [new file with mode: 0644]
i386-dm/qemu-ifup [new file with mode: 0644]
xen-config.mak
xen-hooks.mak

index 39e72bc0dc850c752e90408c9bba6bf514f6c39f..cea4def8036c08f9477d5d4b557c5a92727f3ba6 100644 (file)
@@ -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 (file)
index 0000000..cf4b39e
--- /dev/null
@@ -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 (file)
index 0000000..bcbee92
--- /dev/null
@@ -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
index 256bcef0afdc2155416e1d1ba03579b4772cda92..62106191736df8c13ee1f68db1597fc2168416f2 100644 (file)
@@ -7,3 +7,5 @@ TARGET_ARCH=i386
 CONFIG_SOFTMMU=yes
 
 CFLAGS += -I$(QEMU_ROOT)/hw
+
+bindir = ${prefix}/${LIBLEAFDIR}/xen/bin
index 4962ac2958d49731b418f9c6d178fbff7cec0637..918d9c0c749798c5e1349555481450beecd7738e 100644 (file)
@@ -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