xen/bridge-record-creation.patch

31 lines
1.1 KiB
Diff
Raw Normal View History

Index: xen-3.3.1-testing/tools/examples/network-bridge
===================================================================
--- xen-3.3.1-testing.orig/tools/examples/network-bridge
+++ xen-3.3.1-testing/tools/examples/network-bridge
@@ -249,6 +249,11 @@ op_start () {
create_bridge ${tdev}
+ # Record creation of bridge in /dev/shm/sysconfig/xenbridges so other
+ # tools, e.g. yast2 lan, know that Xen bridging is active.
+ [ -d /dev/shm/sysconfig/xenbridges ] || mkdir /dev/shm/sysconfig/xenbridges
+ touch /dev/shm/sysconfig/xenbridges/${bridge}
+
preiftransfer ${netdev}
transfer_addrs ${netdev} ${tdev}
if ! ifdown ${netdev}; then
@@ -313,6 +318,13 @@ op_stop () {
ip link set ${pdev} name ${netdev}
do_ifup ${netdev}
+ # Remove record of bridge from /dev/shm/sysconfig/xenbridges ...
+ rm -f /dev/shm/sysconfig/xenbridges/${bridge}
+ # ... and directory itself if empty
+ if [ -z "$(ls -A /dev/shm/sysconfig/xenbridges 2>/dev/null)" ]; then
+ rmdir /dev/shm/sysconfig/xenbridges
+ fi
+
for vlan in $vlans ; do ifup $vlan ; done
}