WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [qemu-xen-unstable] portability fixes for qemu-ifup

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [qemu-xen-unstable] portability fixes for qemu-ifup
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Thu, 9 Jul 2009 07:50:30 -0700
Delivery-date: Thu, 09 Jul 2009 07:50:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
commit 5cc34ea27f1cbd1a0560cfca91fb89ccd6d5726f
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Thu Jul 9 15:33:48 2009 +0100

    portability fixes for qemu-ifup
    
    Attached patch applies portability fixes to ioemu's qemu-ifup script:
    - rename qemu-ifup to qemu-ifup-Linux
    - add qemu-ifup-NetBSD for NetBSD
    - Build system picks the right one and installs just that under the
      conventional name.
    
    Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
---
 i386-dm/hookstarget.mak  |    3 ++-
 i386-dm/qemu-ifup        |   37 -------------------------------------
 i386-dm/qemu-ifup-Linux  |   37 +++++++++++++++++++++++++++++++++++++
 i386-dm/qemu-ifup-NetBSD |    3 +++
 4 files changed, 42 insertions(+), 38 deletions(-)

diff --git a/i386-dm/hookstarget.mak b/i386-dm/hookstarget.mak
index cf4b39e..de2a670 100644
--- a/i386-dm/hookstarget.mak
+++ b/i386-dm/hookstarget.mak
@@ -1,5 +1,6 @@
+IOEMU_OS=$(shell uname -s)
 
 install-hook:
        $(INSTALL_DIR) "$(DESTDIR)/$(bindir)"
        $(INSTALL_DIR) "$(DESTDIR)/$(configdir)"
-       $(INSTALL_PROG) qemu-ifup "$(DESTDIR)/$(configdir)/"
+       $(INSTALL_PROG) qemu-ifup-$(IOEMU_OS) 
"$(DESTDIR)/$(configdir)/qemu-ifup"
diff --git a/i386-dm/qemu-ifup b/i386-dm/qemu-ifup
deleted file mode 100644
index bcbee92..0000000
--- a/i386-dm/qemu-ifup
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/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/i386-dm/qemu-ifup-Linux b/i386-dm/qemu-ifup-Linux
new file mode 100644
index 0000000..bcbee92
--- /dev/null
+++ b/i386-dm/qemu-ifup-Linux
@@ -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/i386-dm/qemu-ifup-NetBSD b/i386-dm/qemu-ifup-NetBSD
new file mode 100644
index 0000000..eee7876
--- /dev/null
+++ b/i386-dm/qemu-ifup-NetBSD
@@ -0,0 +1,3 @@
+#!/bin/sh
+ifconfig $1 up
+exec /sbin/brconfig $2 add $1
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [qemu-xen-unstable] portability fixes for qemu-ifup, Ian Jackson <=