From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v7 04/15] libxl: move bootloader data strucutres and prototypes
Date: Wed, 4 Jul 2012 11:16:01 +0100 [thread overview]
Message-ID: <1341396972-49704-4-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1341396972-49704-1-git-send-email-roger.pau@citrix.com>
Move bootloader and related data after all the device stuff, since
libxl__bootloader_state will depend on libxl__ao_device (to perform
the local attach of a device).
This is pure code motion.
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
---
tools/libxl/libxl_internal.h | 166 +++++++++++++++++++++---------------------
1 files changed, 83 insertions(+), 83 deletions(-)
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 7aa46b8..7a75809 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1740,6 +1740,89 @@ _hidden const char *libxl__xen_script_dir_path(void);
_hidden const char *libxl__lock_dir_path(void);
_hidden const char *libxl__run_dir_path(void);
+/*----- device addition/removal -----*/
+
+/* Action to perform (either connect or disconnect) */
+typedef enum {
+ DEVICE_CONNECT,
+ DEVICE_DISCONNECT
+} libxl__device_action;
+
+typedef struct libxl__ao_device libxl__ao_device;
+typedef struct libxl__ao_devices libxl__ao_devices;
+typedef void libxl__device_callback(libxl__egc*, libxl__ao_device*);
+
+/* This functions sets the necessary libxl__ao_device struct values to use
+ * safely inside functions. It marks the operation as "active"
+ * since we need to be sure that all device status structs are set
+ * to active before start queueing events, or we might call
+ * ao_complete before all devices had finished
+ *
+ * libxl__initiate_device_{remove/addition} should not be called without
+ * calling libxl__prepare_ao_device first, since it initializes the private
+ * fields of the struct libxl__ao_device to what this functions expect.
+ *
+ * Once _prepare has been called on a libxl__ao_device, it is safe to just
+ * discard this struct, there's no need to call any destroy function.
+ * _prepare can also be called multiple times with the same libxl__ao_device.
+ */
+_hidden void libxl__prepare_ao_device(libxl__ao *ao, libxl__ao_device *aodev);
+
+/* Prepare a bunch of devices for addition/removal. Every ao_device in
+ * ao_devices is set to 'active', and the ao_device 'base' field is set to
+ * the one pointed by aodevs.
+ */
+_hidden void libxl__prepare_ao_devices(libxl__ao *ao,
+ libxl__ao_devices *aodevs);
+
+/* Generic callback to use when adding/removing several devices, this will
+ * check if the given aodev is the last one, and call the callback in the
+ * parent libxl__ao_devices struct, passing the appropriate error if found.
+ */
+_hidden void libxl__ao_devices_callback(libxl__egc *egc,
+ libxl__ao_device *aodev);
+
+struct libxl__ao_device {
+ /* filled in by user */
+ libxl__ao *ao;
+ libxl__device_action action;
+ libxl__device *dev;
+ int force;
+ libxl__device_callback *callback;
+ /* private for implementation */
+ int active;
+ int rc;
+ libxl__ev_devstate backend_ds;
+ /* Used internally to have a reference to the upper libxl__ao_devices
+ * struct when present */
+ libxl__ao_devices *aodevs;
+};
+
+/* Helper struct to simply the plug/unplug of multiple devices at the same
+ * time.
+ *
+ * This structure holds several devices, and the callback is only called
+ * when all the devices inside of the array have finished.
+ */
+typedef void libxl__devices_callback(libxl__egc*, libxl__ao_devices*, int rc);
+struct libxl__ao_devices {
+ libxl__ao_device *array;
+ int size;
+ libxl__devices_callback *callback;
+};
+
+/* Arranges that dev will be removed to the guest, and the
+ * hotplug scripts will be executed (if necessary). When
+ * this is done (or an error happens), the callback in
+ * aodev->callback will be called.
+ *
+ * The libxl__ao_device passed to this function should be
+ * prepared using libxl__prepare_ao_device prior to calling
+ * this function.
+ */
+_hidden void libxl__initiate_device_remove(libxl__egc *egc,
+ libxl__ao_device *aodev);
+
/*----- datacopier: copies data from one fd to another -----*/
typedef struct libxl__datacopier_state libxl__datacopier_state;
@@ -1961,89 +2044,6 @@ _hidden void libxl__bootloader_init(libxl__bootloader_state *bl);
* If callback is passed rc==0, will have updated st->info appropriately */
_hidden void libxl__bootloader_run(libxl__egc*, libxl__bootloader_state *st);
-/*----- device addition/removal -----*/
-
-/* Action to perform (either connect or disconnect) */
-typedef enum {
- DEVICE_CONNECT,
- DEVICE_DISCONNECT
-} libxl__device_action;
-
-typedef struct libxl__ao_device libxl__ao_device;
-typedef struct libxl__ao_devices libxl__ao_devices;
-typedef void libxl__device_callback(libxl__egc*, libxl__ao_device*);
-
-/* This functions sets the necessary libxl__ao_device struct values to use
- * safely inside functions. It marks the operation as "active"
- * since we need to be sure that all device status structs are set
- * to active before start queueing events, or we might call
- * ao_complete before all devices had finished
- *
- * libxl__initiate_device_{remove/addition} should not be called without
- * calling libxl__prepare_ao_device first, since it initializes the private
- * fields of the struct libxl__ao_device to what this functions expect.
- *
- * Once _prepare has been called on a libxl__ao_device, it is safe to just
- * discard this struct, there's no need to call any destroy function.
- * _prepare can also be called multiple times with the same libxl__ao_device.
- */
-_hidden void libxl__prepare_ao_device(libxl__ao *ao, libxl__ao_device *aodev);
-
-/* Prepare a bunch of devices for addition/removal. Every ao_device in
- * ao_devices is set to 'active', and the ao_device 'base' field is set to
- * the one pointed by aodevs.
- */
-_hidden void libxl__prepare_ao_devices(libxl__ao *ao,
- libxl__ao_devices *aodevs);
-
-/* Generic callback to use when adding/removing several devices, this will
- * check if the given aodev is the last one, and call the callback in the
- * parent libxl__ao_devices struct, passing the appropriate error if found.
- */
-_hidden void libxl__ao_devices_callback(libxl__egc *egc,
- libxl__ao_device *aodev);
-
-struct libxl__ao_device {
- /* filled in by user */
- libxl__ao *ao;
- libxl__device_action action;
- libxl__device *dev;
- int force;
- libxl__device_callback *callback;
- /* private for implementation */
- int active;
- int rc;
- libxl__ev_devstate backend_ds;
- /* Used internally to have a reference to the upper libxl__ao_devices
- * struct when present */
- libxl__ao_devices *aodevs;
-};
-
-/* Helper struct to simply the plug/unplug of multiple devices at the same
- * time.
- *
- * This structure holds several devices, and the callback is only called
- * when all the devices inside of the array have finished.
- */
-typedef void libxl__devices_callback(libxl__egc*, libxl__ao_devices*, int rc);
-struct libxl__ao_devices {
- libxl__ao_device *array;
- int size;
- libxl__devices_callback *callback;
-};
-
-/* Arranges that dev will be removed to the guest, and the
- * hotplug scripts will be executed (if necessary). When
- * this is done (or an error happens), the callback in
- * aodev->callback will be called.
- *
- * The libxl__ao_device passed to this function should be
- * prepared using libxl__prepare_ao_device prior to calling
- * this function.
- */
-_hidden void libxl__initiate_device_remove(libxl__egc *egc,
- libxl__ao_device *aodev);
-
/*----- Domain destruction -----*/
/* Domain destruction has been split into two functions:
--
1.7.7.5 (Apple Git-26)
next prev parent reply other threads:[~2012-07-04 10:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-04 10:15 [PATCH v7 01/15] libxl: change ao_device_remove to ao_device Roger Pau Monne
2012-07-04 10:15 ` [PATCH v7 02/15] libxl: move device model creation prototypes Roger Pau Monne
2012-07-04 10:16 ` [PATCH v7 03/15] libxl: convert libxl_domain_destroy to an async op Roger Pau Monne
2012-07-04 10:16 ` Roger Pau Monne [this message]
2012-07-04 10:16 ` [PATCH v7 05/15] libxl: refactor disk addition to take a helper Roger Pau Monne
2012-07-04 10:16 ` [PATCH v7 06/15] libxl: convert libxl__device_disk_local_attach to an async op Roger Pau Monne
2012-07-04 10:16 ` [PATCH v7 07/15] libxl: rename vifs to nics Roger Pau Monne
2012-07-04 10:16 ` [PATCH v7 08/15] libxl: convert libxl_device_disk_add to an async op Roger Pau Monne
2012-07-04 10:16 ` [PATCH v7 09/15] libxl: convert libxl_device_nic_add to an async operation Roger Pau Monne
2012-07-04 10:16 ` [PATCH v7 10/15] libxl: add option to choose who executes hotplug scripts Roger Pau Monne
2012-07-04 10:16 ` [PATCH v7 11/15] libxl: rename _IOEMU nic type to VIF_IOEMU Roger Pau Monne
2012-07-04 10:16 ` [PATCH v7 12/15] libxl: set correct nic type depending on the guest Roger Pau Monne
2012-07-04 10:16 ` [PATCH v7 13/15] libxl: use libxl__xs_path_cleanup on device_destroy Roger Pau Monne
2012-07-04 10:16 ` [PATCH v7 14/15] libxl: call hotplug scripts for disk devices from libxl Roger Pau Monne
2012-07-04 10:16 ` [PATCH v7 15/15] libxl: call hotplug scripts for nic " Roger Pau Monne
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=1341396972-49704-4-git-send-email-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=ian.jackson@eu.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).