* [PATCH] Refuse to start bridging with network root filesystem
@ 2007-06-26 11:47 Mark McLoughlin
0 siblings, 0 replies; only message in thread
From: Mark McLoughlin @ 2007-06-26 11:47 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 349 bytes --]
Hi,
Since setting up bridging involves bringing down the network interface,
bridging clearly isn't compatible with the likes of NFS or iSCSI root.
The attached patch makes network-bridge try to detect either of these
conditions and refuse to start, logging an error to syslog.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Thanks,
Mark.
[-- Attachment #2: xen-network-root.patch --]
[-- Type: text/x-patch, Size: 886 bytes --]
diff -r 3f76b2f76c2a tools/examples/network-bridge
--- a/tools/examples/network-bridge Mon Jun 25 16:52:39 2007 +0100
+++ b/tools/examples/network-bridge Tue Jun 26 12:41:09 2007 +0100
@@ -172,9 +172,21 @@ show_status () {
echo '============================================================'
}
+is_network_root () {
+ local rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' /etc/mtab)
+ local rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab)
+
+ [[ "$rootfs" =~ "^nfs" ]] || [[ "$rootopts" =~ "_netdev" ]] && return 0 || return 1
+}
+
op_start () {
if [ "${bridge}" = "null" ] ; then
return
+ fi
+
+ if is_network_root ; then
+ [ -x /usr/bin/logger ] && /usr/bin/logger "network-bridge: bridging not supported on network root; not starting"
+ return
fi
if link_exists "$pdev"; then
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-06-26 11:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-26 11:47 [PATCH] Refuse to start bridging with network root filesystem Mark McLoughlin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.