Mailing List Archive

[PATCH 07 of 14 v4] hotplug NetBSD: pass an action instead of a state to hotplug scripts
# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1323766195 -3600
# Node ID 51404e6e2d6f4d53a14deadca4b62748d449782b
# Parent a3a95ea16ca4e34c8213522d4aae854ec16b6057
hotplug NetBSD: pass an action instead of a state to hotplug scripts

change second parameter of NetBSD hotplug scripts to take an action
(CONNECT/DISCONNECT) instead of a xenbus state.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>

diff -r a3a95ea16ca4 -r 51404e6e2d6f tools/hotplug/NetBSD/block
--- a/tools/hotplug/NetBSD/block Fri Sep 30 14:38:55 2011 +0200
+++ b/tools/hotplug/NetBSD/block Tue Dec 13 09:49:55 2011 +0100
@@ -18,12 +18,12 @@ error() {


xpath=$1
-xstatus=$2
+xaction=$2
xtype=$3
xparams=$(xenstore-read "$xpath/params")

-case $xstatus in
-6)
+case $xaction in
+2)
# device removed
case $xtype in
file)
@@ -41,7 +41,7 @@ 6)
xenstore-rm $xpath
exit 0
;;
-2)
+1)
case $xtype in
file)
# Store the list of available vnd(4) devices in
diff -r a3a95ea16ca4 -r 51404e6e2d6f tools/hotplug/NetBSD/vif-bridge
--- a/tools/hotplug/NetBSD/vif-bridge Fri Sep 30 14:38:55 2011 +0200
+++ b/tools/hotplug/NetBSD/vif-bridge Tue Dec 13 09:49:55 2011 +0100
@@ -11,15 +11,15 @@ PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${P
export PATH

xpath=$1
-xstatus=$2
+xaction=$2

-case $xstatus in
-6)
+case $xaction in
+2)
# device removed
xenstore-rm $xpath
exit 0
;;
-2)
+1)
xbridge=$(xenstore-read "$xpath/bridge")
xfid=$(xenstore-read "$xpath/frontend-id")
xhandle=$(xenstore-read "$xpath/handle")
diff -r a3a95ea16ca4 -r 51404e6e2d6f tools/hotplug/NetBSD/vif-ip
--- a/tools/hotplug/NetBSD/vif-ip Fri Sep 30 14:38:55 2011 +0200
+++ b/tools/hotplug/NetBSD/vif-ip Tue Dec 13 09:49:55 2011 +0100
@@ -11,15 +11,15 @@ PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${P
export PATH

xpath=$1
-xstatus=$2
+xaction=$2

-case $xstatus in
-6)
+case $xaction in
+2)
# device removed
xenstore-rm $xpath
exit 0
;;
-2)
+1)
xip=$(xenstore-read "$xpath/ip")
xfid=$(xenstore-read "$xpath/frontend-id")
xhandle=$(xenstore-read "$xpath/handle")

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: [PATCH 07 of 14 v4] hotplug NetBSD: pass an action instead of a state to hotplug scripts [ In reply to ]
Roger Pau Monne writes ("[Xen-devel] [PATCH 07 of 14 v4] hotplug NetBSD: pass an action instead of a state to hotplug scripts"):
> hotplug NetBSD: pass an action instead of a state to hotplug scripts
>
> change second parameter of NetBSD hotplug scripts to take an action
> (CONNECT/DISCONNECT) instead of a xenbus state.

Aren't these hotplug scripts generally installed in /etc, where people
and tools will avoid simply overwriting old versions with new ?

In which case this apparently-subtle but actually-radical change to
their API might be a problem.

Or am I wrong ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel