All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Hongyang <yanghy@cn.fujitsu.com>
To: xen-devel@lists.xen.org
Cc: ian.campbell@citrix.com, wency@cn.fujitsu.com,
	ian.jackson@eu.citrix.com, yunhong.jiang@intel.com,
	eddie.dong@intel.com, rshriram@cs.ubc.ca, laijs@cn.fujitsu.com
Subject: [PATCH for-4.5 v20 01/12] libxl: introduce libxl__multidev_prepare_with_aodev
Date: Thu, 25 Sep 2014 14:16:13 +0800	[thread overview]
Message-ID: <1411625784-4060-2-git-send-email-yanghy@cn.fujitsu.com> (raw)
In-Reply-To: <1411625784-4060-1-git-send-email-yanghy@cn.fujitsu.com>

libxl__multidev_prepare_with_aodev is similar to libxl__multidev_prepare,
but takes a libxl__ao_device as an extra argument.
libxl__multidev_prepare is now a wrapper around
libxl__multidev_prepare_with_aodev.

This new internal API will be used by the Remus device abstract layer
for handling various Remus devices.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_device.c   | 13 ++++++++++---
 tools/libxl/libxl_internal.h | 14 +++++++++++---
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 3425446..903cd41 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -481,11 +481,10 @@ void libxl__multidev_begin(libxl__ao *ao, libxl__multidev *multidev)
 
 static void multidev_one_callback(libxl__egc *egc, libxl__ao_device *aodev);
 
-libxl__ao_device *libxl__multidev_prepare(libxl__multidev *multidev) {
+void libxl__multidev_prepare_with_aodev(libxl__multidev *multidev,
+                                        libxl__ao_device *aodev) {
     STATE_AO_GC(multidev->ao);
-    libxl__ao_device *aodev;
 
-    GCNEW(aodev);
     aodev->multidev = multidev;
     aodev->callback = multidev_one_callback;
     libxl__prepare_ao_device(ao, aodev);
@@ -495,6 +494,14 @@ libxl__ao_device *libxl__multidev_prepare(libxl__multidev *multidev) {
         GCREALLOC_ARRAY(multidev->array, multidev->allocd);
     }
     multidev->array[multidev->used++] = aodev;
+}
+
+libxl__ao_device *libxl__multidev_prepare(libxl__multidev *multidev) {
+    STATE_AO_GC(multidev->ao);
+    libxl__ao_device *aodev;
+
+    GCNEW(aodev);
+    libxl__multidev_prepare_with_aodev(multidev, aodev);
 
     return aodev;
 }
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index f61673c..e931334 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2170,9 +2170,17 @@ struct libxl__ao_device {
 /* Starts preparing to add/remove a bunch of devices. */
 _hidden void libxl__multidev_begin(libxl__ao *ao, libxl__multidev*);
 
-/* Prepares to add/remove one of many devices.  Returns a libxl__ao_device
- * which has had libxl__prepare_ao_device called, and which has also
- * had ->callback set.  The user should not mess with aodev->callback. */
+/* Prepares to add/remove one of many devices.
+ * Calls libxl__prepare_ao_device on libxl__ao_device argument provided and
+ * also sets the ->callback. The user should not mess with aodev->callback.
+ */
+_hidden void libxl__multidev_prepare_with_aodev(libxl__multidev*,
+                                                libxl__ao_device*);
+
+/* A wrapper function around libxl__multidev_prepare_with_aodev.
+ * Allocates a libxl__ao_device and prepares it for addition/removal.
+ * Returns the newly allocated libxl__ao_dev.
+ */
 _hidden libxl__ao_device *libxl__multidev_prepare(libxl__multidev*);
 
 /* Notifies the multidev machinery that we have now finished preparing
-- 
1.9.1

  reply	other threads:[~2014-09-25  6:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25  6:16 [PATCH for-4.5 v20 00/12] Remus/Libxl: Remus network buffering and drbd disk Yang Hongyang
2014-09-25  6:16 ` Yang Hongyang [this message]
2014-09-25  6:16 ` [PATCH for-4.5 v20 02/12] libxl: Extend libxl__ao_device with a libxl__ev_child member Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 03/12] autoconf: add libnl3 dependency for Remus network buffering support Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 04/12] libxl/remus: introduce an abstract Remus device layer Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 05/12] libxl/remus: setup and control network output buffering Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 06/12] libxl/remus: setup and control disk replication for DRBD backends Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 07/12] xl/remus: change bool to defbool Yang Hongyang
2014-09-25 19:21   ` Konrad Rzeszutek Wilk
2014-09-25 20:03     ` Shriram Rajagopalan
2014-09-25 23:38       ` Ian Jackson
2014-09-26 14:02         ` Konrad Rzeszutek Wilk
2014-09-25  6:16 ` [PATCH for-4.5 v20 08/12] xl/remus: cmdline switch to explicitly enable unsafe configurations Yang Hongyang
2014-09-25 19:23   ` Konrad Rzeszutek Wilk
2014-09-25  6:16 ` [PATCH for-4.5 v20 09/12] xl/remus: cmdline switches and config vars to control network buffering Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 10/12] xl/remus: add a cmdline switch to disable disk replication Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 11/12] libxl/remus: add LIBXL_HAVE_REMUS to indicate Remus support in libxl Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 12/12] MAINTAINERS: update maintained files of Remus Yang Hongyang
2014-09-25 19:24   ` Konrad Rzeszutek Wilk
2014-09-25 19:28 ` [PATCH for-4.5 v20 00/12] Remus/Libxl: Remus network buffering and drbd disk Konrad Rzeszutek Wilk
2014-09-26  5:40   ` Hongyang Yang

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=1411625784-4060-2-git-send-email-yanghy@cn.fujitsu.com \
    --to=yanghy@cn.fujitsu.com \
    --cc=eddie.dong@intel.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=wency@cn.fujitsu.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yunhong.jiang@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.