From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH RFC 02/10] libxl: add new hotplug interface support to hotplug script callers
Date: Fri, 18 Jan 2013 17:24:30 +0100 [thread overview]
Message-ID: <50F9773E.5060406@citrix.com> (raw)
In-Reply-To: <1358515771.3279.33.camel@zakaz.uk.xensource.com>
On 18/01/13 14:29, Ian Campbell wrote:
> On Fri, 2012-12-21 at 17:00 +0000, Roger Pau Monne wrote:
>> Add support to call hotplug scripts that use the new hotplug interface
>> to the low-level functions in charge of calling hotplug scripts. This
>> new calling convention will be used when the hotplug_version aodev
>> field is 1.
>
> Is there perhaps some way we can avoid users having to think about the
> hotplug_version?
>
> For example if we export XENBUGS_PATH as a synonym for BACKEND_PATH and
> arrange that the new protocol involves calling action "add" and
> "remove" (as well as the other new ones) do old scripts mostly Just Work
> because they ignore the prepare/unprepare calls? (as a small sample
> vif-bridge and block-nbd seem to).
I'm afraid old scripts will return an error when called with commands
different than "add" or "remove", this is from block-common.sh:
if [ "$command" != "add" ] &&
[ "$command" != "remove" ]
then
log err "Invalid command: $command"
exit 1
fi
> Alternatively by way of backwards compat perhaps we could provide a
> wrapper script? So if today you use script="/my-custom-script" you would
> switch to script="/etc/xen/hotplug-compat-wrapper /my-custom-script" and
> the wrapper would shim or ignore the new calls into the old?
Well, from a user point of view, this will still be the same, old
hotplug scripts will be called using the "script" config option, so
there will be no need to change configuration files. The only difference
is that when calling hotplug scripts using the new hotplug interface
users should use "method" instead of "script" in their config file, as
an example this would be the diskspec line to attach a disk using the
iSCSI block script:
'method=block-iscsi,vdev=xvda,target=iqn=iqn.1994-04.org.netbsd.iscsi-target:target0,portal=192.168.1.128'
Users don't have to deal directly with hotplug_version, I think forcing
them to user a wrapper is worse, because that will mean modifications to
config files when updating.
>>
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>> ---
>> tools/libxl/libxl_device.c | 33 +++++++++++++++++++-
>> tools/libxl/libxl_internal.h | 33 ++++++++++++++++++--
>> tools/libxl/libxl_linux.c | 68 ++++++++++++++++++++++++++++++++----------
>> tools/libxl/libxl_netbsd.c | 2 +-
>> 4 files changed, 115 insertions(+), 21 deletions(-)
>>
>> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
>> index 58d3f35..85c9953 100644
>> --- a/tools/libxl/libxl_device.c
>> +++ b/tools/libxl/libxl_device.c
>> @@ -83,6 +83,35 @@ out:
>> return rc;
>> }
>>
>> +char *libxl__device_hotplug_action(libxl__gc *gc,
>> + libxl__device_action action)
>> +{
>
> If you define libxl__device_action in
> tools/libxl/libxl_types_internal.idl you'll get this for free.
Thanks, will do that then.
> [...]
>> diff --git a/tools/libxl/libxl_netbsd.c b/tools/libxl/libxl_netbsd.c
>> index 9587833..8061e7a 100644
>> --- a/tools/libxl/libxl_netbsd.c
>> +++ b/tools/libxl/libxl_netbsd.c
>> @@ -62,7 +62,7 @@ out:
>> int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev,
>> char ***args, char ***env,
>> libxl__device_action action,
>> - int num_exec)
>> + int num_exec, int hotplug_version)
>
> Is it worth wrapping verison and action into a little
> libxl__hotplug_action struct?
It will slim down the list of parameters to pass to this function, which
is already too long for my taste.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2013-01-18 16:24 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-21 16:59 [PATCH RFC 00/10] libxl: new hotplug calling convention Roger Pau Monne
2012-12-21 16:59 ` [PATCH RFC 01/10] libxl: libxl__prepare_ao_device should reset num_exec Roger Pau Monne
2013-01-17 13:57 ` Ian Campbell
2012-12-21 17:00 ` [PATCH RFC 02/10] libxl: add new hotplug interface support to hotplug script callers Roger Pau Monne
2013-01-18 13:29 ` Ian Campbell
2013-01-18 16:24 ` Roger Pau Monné [this message]
2013-01-21 10:07 ` Ian Campbell
2013-01-21 12:11 ` Roger Pau Monné
2013-01-21 12:18 ` Ian Campbell
2013-01-22 9:30 ` Roger Pau Monné
2012-12-21 17:00 ` [PATCH RFC 03/10] libxl: add new "method" parameter to xl disk config Roger Pau Monne
2013-01-17 15:49 ` Ian Campbell
2012-12-21 17:00 ` [PATCH RFC 04/10] libxl: add prepare/unprepare operations to the libxl public interface Roger Pau Monne
2012-12-21 17:00 ` [PATCH RFC 05/10] libxl: add disk specific remove functions Roger Pau Monne
2012-12-21 17:00 ` [PATCH RFC 06/10] xl: add support for new hotplug interface to block-attach/detach Roger Pau Monne
2012-12-21 17:00 ` [PATCH RFC 07/10] libxl: add local attach support for new hotplug scripts Roger Pau Monne
2012-12-21 17:00 ` [PATCH RFC 08/10] libxl: add new hotplug interface support for HVM guests Roger Pau Monne
2012-12-21 17:00 ` [PATCH RFC 09/10] hotplug: document new hotplug interface Roger Pau Monne
2012-12-21 17:00 ` [PATCH RFC 10/10] hotplug/Linux: add iscsi block hotplug script Roger Pau Monne
2013-01-15 16:56 ` [PATCH RFC 00/10] libxl: new hotplug calling convention Roger Pau Monné
2013-01-17 13:56 ` Ian Campbell
2013-01-17 15:30 ` Roger Pau Monné
2013-01-17 15:40 ` Ian Campbell
2013-01-17 15:47 ` Roger Pau Monné
2013-01-17 15:57 ` Ian Campbell
2013-01-17 16:10 ` Roger Pau Monné
2013-01-17 16:15 ` Ian Campbell
2013-01-17 16:45 ` Roger Pau Monné
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50F9773E.5060406@citrix.com \
--to=roger.pau@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).