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

Re: [Xen-devel] [PATCH v2 8/9] docs: Document block-script protocol



On Thu, 24 Mar 2016, George Dunlap wrote:
> On Wed, Mar 23, 2016 at 12:14 PM, Roger Pau Monné <roger.pau@xxxxxxxxxx> 
> wrote:
> > On Wed, 23 Mar 2016, George Dunlap wrote:
> >> On 22/03/16 12:52, Roger Pau Monné wrote:
> >> > On Mon, 21 Mar 2016, George Dunlap wrote:
> >> >> Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxx>
> >> >> ---
> >> >> Changes since v1:
> >> >> - Attempt to make a clear distinction between custom hotplug scripts
> >> >> and the script called for raw physical devices and files
> >> >>
> >> >> CC: Ian Jackson <ian.jackson@xxxxxxxxxx>
> >> >> CC: Wei Liu <wei.liu2@xxxxxxxxxx>
> >> >> CC: Roger Pau Monne <roger.pau@xxxxxxxxxx>
> >> >> ---
> >> >>  docs/misc/block-scripts.txt | 101 
> >> >> ++++++++++++++++++++++++++++++++++++++++++++
> >> >>  1 file changed, 101 insertions(+)
> >> >>
> >> >> diff --git a/docs/misc/block-scripts.txt b/docs/misc/block-scripts.txt
> >> >> new file mode 100644
> >> >> index 0000000..6dd5d48
> >> >> --- /dev/null
> >> >> +++ b/docs/misc/block-scripts.txt
> >> >> @@ -0,0 +1,101 @@
> >> > [...]
> >> >> +Inputs
> >> >> +------
> >> >> +
> >> >> +In all cases, the scripts are called with either "add" or "remove" as
> >> >> +the command.  For custom scripts, the command will be the first
> >> >> +argument of the script (i.e. $1).
> >> >> +
> >> >> +The environment variable XENBUS_PATH will be set to the
> >> >> +path for the block device to be created.
> >> >
> >> > This is true for Linux, but not for NetBSD. On NetBSD no env variables 
> >> > are
> >> > needed, and everything is passed as arguments using the following format:
> >> >
> >> > ./<script> <backend_path> <xenbus state>
> >> >
> >> > Where xenbus state is either 2 or 6.
> >> >
> >> > On FreeBSD I'm aiming of using the same input interface for both block 
> >> > and
> >> > network scripts, and it is the following:
> >> >
> >> > ./<script> {add/remove} <backend path>
> >> >
> >> > With no env variables provided at all. So either this section is 
> >> > expanded,
> >> > or it is labelled as "Linux Inputs".
> >>
> >> Nothing like consistency across implementations. :-)
> >>
> >> So in the case of NetBSD, "2" means 'add' and "6" means 'remove'?  Or
> >> how does that work?
> >
> > Yes, 2 means add and 6 remove.
> >
> >> Presumably there's not much we can do about NetBSD at this point, if
> >> there are (or may be) out-of-tree scripts that expect the new format.
> >> But unless there's a good reason, it seems like we should try to
> >> converge the hotplug script protocol.
> >>
> >> Was there a particular reason you wanted to use an argument instead of
> >> an environment variable?  If not, it's probably better to just follow
> >> suit with the Linux protocol.
> >
> > Don't get me wrong, but the Linux protocol is all but consistent :). I'm
> > not sure if those other env variables are used by the block hotplug
> > scripts, but we also set:
> >
> > script=<script_name>
> > XENBUS_TYPE=<vbd/vif>
> > XENBUS_PATH=<be_path>
> > XENBUS_BASE_PATH="backend"
> >
> > And it's even worse for vifs, where the action parameter that we pass to
> > the hotplug script is different depending on whether we are dealing with
> > a PV or an emulated interface (PV uses "online/offline", while emulated
> > use "add/remove").
> >
> > I would like to share the same interface, but I think the Linux one is
> > simply too broken, and I don't want to put this anywhere close to FreeBSD.
> > There at least I have a chance of having something that's simple and
> > rational.
> 
> OK, so how about this.  I'll post the document with the input sections
> like this:
> [snip]
> 
> Inputs
> ------
> 
> Unfortunately the inputs to the block scripts look completely
> different for each operating system.
> 
> Inputs (Linux)
> --------------
> 
> In all cases, the scripts are called with either "add" or "remove" as
> the command.  For custom scripts, the command will be the first
> argument of the script (i.e. $1).
> 
> The environment variable XENBUS_PATH will be set to the
> path for the block device to be created.
> 
> When the script is run, the following nodes shall already have been
> written into xenstore:
> 
>  $XENBUS/params    The contents of the 'target' section of the disk
> specification verbatim.
>  $XENBUS/mode      'r' (for readonly) or 'w' (for read-write)
> 
> Inputs (NetBSD)
> ---------------
> 
> TODO
> 
> [snip]
> 
> And you add a FreeBSD section in your series.  If that sounds good
> I'll make the above modification and send v3.

LGTM :).

Roger.
_______________________________________________
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®.