~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/hotplug/NetBSD/vif-bridge

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
 
 
3
# $NetBSD: vif-bridge-nbsd,v 1.1.1.1 2008/08/07 20:26:57 cegger Exp $
 
4
# Called by xenbackendd
 
5
# Usage: vif-bridge xsdir_backend_path state
 
6
 
 
7
DIR=$(dirname "$0")
 
8
. "${DIR}/hotplugpath.sh"
 
9
 
 
10
PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
 
11
export PATH
 
12
 
 
13
xpath=$1
 
14
xstatus=$2
 
15
 
 
16
case $xstatus in
 
17
6)
 
18
        # device removed
 
19
        xenstore-rm $xpath
 
20
        exit 0
 
21
        ;;
 
22
2)
 
23
        xbridge=$(xenstore-read "$xpath/bridge")
 
24
        xfid=$(xenstore-read "$xpath/frontend-id")
 
25
        xhandle=$(xenstore-read "$xpath/handle")
 
26
        iface=xvif$xfid.$xhandle
 
27
        echo ifconfig $iface up
 
28
        ifconfig $iface up
 
29
        brconfig $xbridge add $iface
 
30
        echo brconfig $xbridge add $iface
 
31
        xenstore-write $xpath/hotplug-status connected
 
32
        echo xenstore-write $xpath/hotplug-status connected
 
33
        exit 0
 
34
        ;;
 
35
*)
 
36
        exit 0
 
37
        ;;
 
38
esac