[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC 14/23] hotplug: add FreeBSD vif-bridge



On Wed, 2014-04-16 at 16:13 +0200, Roger Pau Monne wrote:
> Add a simple vif-bridge script, that takes care of adding network
> backends (tap or xnb) to a pre-configured bridge.

Compared with the Linux one it lacks the handling of the vifname
property and the attempt to provide a default if no bridge was
specified. This is probably acceptable I suppose.

> 
> Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
> Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> ---
>  tools/hotplug/FreeBSD/Makefile   |    2 +-
>  tools/hotplug/FreeBSD/vif-bridge |   41 
> ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 42 insertions(+), 1 deletions(-)
>  create mode 100644 tools/hotplug/FreeBSD/vif-bridge
> 
> diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
> index c7ffc51..6480aa5 100644
> --- a/tools/hotplug/FreeBSD/Makefile
> +++ b/tools/hotplug/FreeBSD/Makefile
> @@ -2,7 +2,7 @@ XEN_ROOT = $(CURDIR)/../../..
>  include $(XEN_ROOT)/tools/Rules.mk
>  
>  # Xen script dir and scripts to go there.
> -XEN_SCRIPTS =
> +XEN_SCRIPTS = vif-bridge
>  
>  XEN_SCRIPT_DATA =
>  
> diff --git a/tools/hotplug/FreeBSD/vif-bridge 
> b/tools/hotplug/FreeBSD/vif-bridge
> new file mode 100644
> index 0000000..b36d075
> --- /dev/null
> +++ b/tools/hotplug/FreeBSD/vif-bridge
> @@ -0,0 +1,41 @@
> +#!/bin/sh -e
> +#
> +# FreeBSD hotplug script for attaching xnb* interfaces to bridges
> +#
> +# Parameters:
> +#    $1: xenstore backend path of the vif
> +#    $2: action, either "add" or "remove"
> +#
> +# Environment variables:
> +#    $iface_dev: name of the backend device (xnb<domid>.<handle>)
> +#
> +
> +DIR=$(dirname "$0")
> +. "${DIR}/hotplugpath.sh"
> +
> +PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
> +export PATH
> +
> +xpath=$1
> +xaction=$2

OOI why the x prefixes everywhere?

> +
> +case $xaction in
> +add)
> +     xbridge=$(xenstore-read "$xpath/bridge")
> +     ifconfig $xbridge addm $iface_dev
> +     ifconfig $iface_dev up
> +     exit 0
> +     ;;
> +remove)
> +     if [ "$emulated" -eq 1 ]; then
> +             xbridge=$(xenstore-read "$xpath/bridge")
> +             ifconfig $iface_dev down
> +             ifconfig $xbridge deletem $iface_dev
> +             ifconfig $iface_dev destroy
> +     fi
> +     exit 0
> +     ;;
> +*)
> +     exit 0
> +     ;;
> +esac



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.