This commit is contained in:
committed by
Git OBS Bridge
parent
1e7cc04da7
commit
b82e0d6f19
@@ -56,20 +56,52 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/i386-dm/qemu-ifup
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/i386-dm/qemu-ifup
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/i386-dm/qemu-ifup
|
||||
@@ -1,11 +1,11 @@
|
||||
@@ -1,36 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
-#. /etc/rc.d/init.d/functions
|
||||
-#ulimit -c unlimited
|
||||
-
|
||||
-echo 'config qemu network with xen bridge for ' $*
|
||||
-
|
||||
echo 'config qemu network with xen bridge for ' $*
|
||||
|
||||
+# If bridge is not specified, try device with default route.
|
||||
bridge=$2
|
||||
+if [ -z "$bridge" ]; then
|
||||
+ brnum=$(ip route list | awk '/^default / { print $NF }' | sed 's/^[^0-9]*//')
|
||||
+ brnum=${brnum:-0}
|
||||
+ bridge=xenbr${brnum}
|
||||
+ bridge=$(ip route list | awk '/^default / { print $NF }')
|
||||
+fi
|
||||
|
||||
#
|
||||
# Old style bridge setup with netloop, used to have a bridge name
|
||||
-#
|
||||
-# 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*}" ]
|
||||
+# Exit if $bridge is not a bridge. Exit with 0 status
|
||||
+# so qemu-dm process is not terminated. No networking in
|
||||
+# vm is bad but not catastrophic. The vm could still run
|
||||
+# cpu and disk IO workloads.
|
||||
+# Include an useful error message in qemu-dm log file.
|
||||
+if [ ! -e "/sys/class/net/${bridge}/bridge" ]
|
||||
then
|
||||
- if [ -e "/sys/class/net/eth${bridge#xenbr}/bridge" ]
|
||||
- then
|
||||
- bridge="eth${bridge#xenbr}"
|
||||
- fi
|
||||
+ echo "WARNING! ${bridge} is not a bridge. qemu-ifup exiting. VM may not have a functioning networking stack."
|
||||
+ exit 0
|
||||
fi
|
||||
|
||||
ifconfig $1 0.0.0.0 up
|
||||
|
Reference in New Issue
Block a user