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-devel

Re: [Xen-devel] Cannot create domU

  Hi,

At the moment, installing our script at /etc/hotplug/xen-backend.agent 'just works' for us.

Doesn't work on SUSE Linux 10.0 as well, as all the agents are gone here as well. The huge stack of shell scripts was replaced with a few udev rules, so it's easier to see what's going on and it also is much faster.

I've attached my current configuration. ifup-xen goes to /sbin, the rules file into /etc/udev/rules.d. With those two files in place auto-adding interfaces to the bridge WorksForMe[tm]. The script is sort of a hack though, quickly created from the vif-bridge script, with no way to configure stuff at the moment.

cheers,

  Gerd
SUBSYSTEM=="net", KERNEL=="vif*", ACTION=="add", RUN+="/sbin/ifup-xen %k"
#!/bin/sh
netdev="$1"
bridge="${bridge:-xenbr0}"

PATH="/sbin:/bin:/usr/sbin:/usr/bin"

# Usage: create_bridge bridge
create_bridge () {
    local bridge=$1

    # Don't create the bridge if it already exists.
    if brctl show | grep -q ${bridge}; then
        return
    fi

    brctl addbr ${bridge}
    brctl stp ${bridge} off
    brctl setfd ${bridge} 0
    ip link set ${bridge} up
}

# Usage: add_to_bridge bridge dev
add_to_bridge () {
    local bridge=$1
    local dev=$2

    # Don't add $dev to $bridge if it's already on a bridge.
    if brctl show | grep -q ${dev} ; then
        return
    fi

    brctl addif ${bridge} ${dev}
    ip link set ${dev} arp off
    ip link set ${dev} up
}

create_bridge ${bridge}
add_to_bridge ${bridge} ${netdev}

echo "$(date): $0: ${bridge} ${netdev}"         >> /tmp/net-xen
env                                             >> /tmp/net-xen

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>