Mailing List Archive

[PATCH 08 of 14 v4] xenbackendd: pass action to hotplug script
# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1323766195 -3600
# Node ID 30f2db9a780fe36eeacf6dabd76bb2577248edea
# Parent 51404e6e2d6f4d53a14deadca4b62748d449782b
xenbackendd: pass action to hotplug script

Pass an action to hotplug scripts instead of a xenbus state.

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

diff -r 51404e6e2d6f -r 30f2db9a780f tools/xenbackendd/xenbackendd.c
--- a/tools/xenbackendd/xenbackendd.c Tue Dec 13 09:49:55 2011 +0100
+++ b/tools/xenbackendd/xenbackendd.c Tue Dec 13 09:49:55 2011 +0100
@@ -34,6 +34,9 @@
#define DEVTYPE_VIF 1
#define DEVTYPE_VBD 2

+#define CONNECT "1"
+#define DISCONNECT "2"
+
#define DOMAIN_PATH "/local/domain/0"

#ifndef XEN_SCRIPT_DIR
@@ -150,6 +153,7 @@ main(int argc, char * const argv[])
unsigned int num;
char *s;
int state;
+ char *action;
char *sstate;
char *stype;
char *params;
@@ -300,7 +304,8 @@ main(int argc, char * const argv[])
strerror(errno));
goto next2;
}
- doexec(s, vec[XS_WATCH_PATH], sstate, NULL);
+ action = (state == 6 ? DISCONNECT : CONNECT);
+ doexec(s, vec[XS_WATCH_PATH], action, NULL);
break;

case DEVTYPE_VBD:
@@ -329,7 +334,8 @@ main(int argc, char * const argv[])
params, strerror(errno));
goto next3;
}
- doexec(vbd_script, vec[XS_WATCH_PATH], sstate, stype);
+ action = (state == 6 ? DISCONNECT : CONNECT);
+ doexec(vbd_script, vec[XS_WATCH_PATH], action, stype);
next3:
free(params);
break;

_______________________________________________
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 [and 1 more messages] [ 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.

Roger Pau Monne writes ("[Xen-devel] [PATCH 08 of 14 v4] xenbackendd: pass action to hotplug script"):
> xenbackendd: pass action to hotplug script
>
> Pass an action to hotplug scripts instead of a xenbus state.
>
> Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>

Also I have just spotted that you seem to have made two halves of a
mutually-incompatble change in different patches.

Don't do that, because it breaks bisectability. The tree should be
buildable and useable at every point.

Thanks,
Ian.

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