From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xen.org
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH RFC 09/10] hotplug: document new hotplug interface
Date: Fri, 21 Dec 2012 18:00:07 +0100 [thread overview]
Message-ID: <1356109208-6830-10-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1356109208-6830-1-git-send-email-roger.pau@citrix.com>
Mention the new diskspec parameter and add a document explaining the
new hotplug interface.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
docs/misc/libxl-hotplug-interface.txt | 156 +++++++++++++++++++++++++++++++++
docs/misc/xl-disk-configuration.txt | 11 +++
2 files changed, 167 insertions(+), 0 deletions(-)
create mode 100644 docs/misc/libxl-hotplug-interface.txt
diff --git a/docs/misc/libxl-hotplug-interface.txt b/docs/misc/libxl-hotplug-interface.txt
new file mode 100644
index 0000000..5187e44
--- /dev/null
+++ b/docs/misc/libxl-hotplug-interface.txt
@@ -0,0 +1,156 @@
+ -----------------------
+ LIBXL HOTPLUG INTERFACE
+ -----------------------
+
+This document specifies the new libxl hotplug interface. This new
+interface has been designed to operate better with complex hotplug
+scripts, that need to perform several operations and can take a
+considerable time to execute.
+
+Hotplug scripts are expected to take a parameter, passed by the caller
+and provide a block device as output, that will be attached to the guest.
+
+
+
+=====================
+ENVIRONMENT VARIABLES
+=====================
+
+
+The following environment variables will be set before calling
+the hotplug script.
+
+
+HOTPLUG_PATH
+------------
+
+Points to the xenstore directory that holds information relative
+to this hotplug script. At present only one parameter is passed by
+the toolstack, the "params" xenstore entry which contains the "target"
+line specified in the diskspec xl disk configuration (pdev_path in
+libxl_device_disk struct).
+
+This xenstore directory will be used to communicate between the
+hotplug script and the toolstack, and it can also be used by the
+hotplug script to store temporary information. This directory is created
+before calling the "prepare" operation, and the toolstack guarantees
+that it will not be removed before the "unprepare" operation has been
+finished. After that, the toolstack will take the appropriate actions
+to remove it. The toolstack guarantees that HOTPLUG_PATH will always
+point to a valid xenstore path for all operations.
+
+The path of this directory follows the syntax:
+
+/local/domain/<local_domid>/libxl/hotplug/<guest_domid>/<device_id>
+
+(Note that there is no end slash appended to HOTPLUG_PATH)
+
+
+BACKEND_PATH
+------------
+
+Points to the xenstore backend path of the corresponding block device.
+Since hotplug scripts are always executed in the Domain that acts as
+backend for a device, it will always have the following syntax:
+
+/local/domain/<local_domain>/backend/vbd/<guest_domid>/<device_id>
+
+(Note that there is no end slash appended to BACKEND_PATH)
+
+This environment variable is not set for all operations, since some
+hotplug operations are executed before the backend xenstore is set up.
+
+
+
+=======================
+COMMAND LINE PARAMETERS
+=======================
+
+
+Script will be called with only one parameter, that is either prepare,
+add, remove, unprepare, localattach or localdetach.
+
+
+PREPARE
+-------
+
+This is the first operation that the hotplug script will be requested to
+execute. This operation is executed before the disk is connected, to
+give the hotplug script the chance to offload some work from the "add"
+operation, that is performed later.
+
+BACKEND_PATH: not valid
+
+Expected output:
+None
+
+
+ADD
+---
+
+This operation should connect the device to the domain. Will only be called
+after the "prepare" operation has finished successfully.
+
+BACKEND_PATH: valid
+
+Expected output:
+BACKEND_PATH/physical-device = block device major:minor
+BACKEND_PATH/params = block device path
+HOTPLUG_PATH/pdev = block device path
+
+
+REMOVE
+------
+
+
+Disconnects a block device from a domain. Will only be called
+after the "prepare" operation has finished successfully. Implementations
+should take into account that the "remove" operation will also be called if
+the "add" operation has failed.
+
+BACKEND_PATH: valid
+
+Expected output:
+None
+
+
+LOCALATTACH
+-----------
+
+
+Creates a block device in the current domain that points to the guest
+disk device. Will only be called after the "prepare" operation has
+finished successfully.
+
+BACKEND_PATH: not valid
+
+Expected output:
+HOTPLUG_PATH/pdev = block device path
+
+
+LOCALDETACH
+-----------
+
+
+Disconnects a device (previously connected with the localattach
+operation) from the current domain. Will only be called after
+the "prepare" operation has finished successfully. Implementations
+should take into account that the "localdetach" operation will
+also be called if the "localattach" operation has failed.
+
+BACKEND_PATH: not valid
+
+Expected output:
+None
+
+
+UNPREPARE
+---------
+
+
+Performs the necessary actions to unprepare the device.
+
+BACKEND_PATH: not valid
+
+Expected output:
+None
diff --git a/docs/misc/xl-disk-configuration.txt b/docs/misc/xl-disk-configuration.txt
index 86c16be..d78acdb 100644
--- a/docs/misc/xl-disk-configuration.txt
+++ b/docs/misc/xl-disk-configuration.txt
@@ -166,6 +166,17 @@ information to be interpreted by the executable program <script>,
These scripts are normally called "block-<script>".
+method=<script>
+---------------
+
+Specifies that <target> is not a normal host path, but rather
+information to be interpreted by the executable program <script>,
+(looked for in /etc/xen/scripts, if it doesn't contain a slash).
+
+The script passed as parameter should support the new hotplug
+script interface, which is defined in libxl-hotplug-interface.txt.
+
+
============================================
DEPRECATED PARAMETERS, PREFIXES AND SYNTAXES
--
1.7.7.5 (Apple Git-26)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2012-12-21 17:00 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é
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 ` Roger Pau Monne [this message]
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=1356109208-6830-10-git-send-email-roger.pau@citrix.com \
--to=roger.pau@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).