mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Attached patch introduces xenbackendd. It is used on NetBSD to launch the hotplug scripts. Later xenbackendd can be improved to also launch qemu-dm as child process and will notice when qemu-dm crashes. The changes the patch makes: - rename hotplug scripts as xenbackendd expects them (current names were taken from pkgsrc) - install hotplug scripts as executable scripts - introduce xenbackendd - build/install/launch on NetBSD only Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
37 lines
719 B
Bash
37 lines
719 B
Bash
#!/bin/sh -e
|
|
|
|
# $NetBSD: vif-ip-nbsd,v 1.1.1.1 2008/08/07 20:26:57 cegger Exp $
|
|
# Called by xenbackendd
|
|
# Usage: vif-ip xsdir_backend_path state
|
|
|
|
DIR=$(dirname "$0")
|
|
. "${DIR}/hotplugpath.sh"
|
|
|
|
PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
|
|
export PATH
|
|
|
|
xpath=$1
|
|
xstatus=$2
|
|
|
|
case $xstatus in
|
|
6)
|
|
# device removed
|
|
xenstore-rm $xpath
|
|
exit 0
|
|
;;
|
|
2)
|
|
xip=$(xenstore-read "$xpath/ip")
|
|
xfid=$(xenstore-read "$xpath/frontend-id")
|
|
xhandle=$(xenstore-read "$xpath/handle")
|
|
iface=xvif$xfid.$xhandle
|
|
echo ifconfig $iface $xip up
|
|
ifconfig $iface $xip up
|
|
xenstore-write $xpath/hotplug-status connected
|
|
echo xenstore-write $xpath/hotplug-status connected
|
|
exit 0
|
|
;;
|
|
*)
|
|
exit 0
|
|
;;
|
|
esac
|