xen-devel.lists.xenproject.org archive mirror
 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,
	andrew.cooper3@citrix.com, yunhong.jiang@intel.com,
	ian.jackson@eu.citrix.com, eddie.dong@intel.com,
	rshriram@cs.ubc.ca, laijs@cn.fujitsu.com
Subject: [PATCH v19 01/12] libxl: introduce libxl__multidev_prepare_with_aodev
Date: Tue, 2 Sep 2014 11:34:29 +0800	[thread overview]
Message-ID: <1409628880-22471-2-git-send-email-yanghy@cn.fujitsu.com> (raw)
In-Reply-To: <1409628880-22471-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 f8a2e1b..9180732 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -463,11 +463,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);
@@ -477,6 +476,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 beb052e..611b9fb 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2148,9 +2148,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-02  3:34 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02  3:34 [PATCH v19 00/12] Remus/Libxl: Remus network buffering and drbd disk Yang Hongyang
2014-09-02  3:34 ` Yang Hongyang [this message]
2014-09-02  3:34 ` [PATCH v19 02/12] libxl: Extend libxl__ao_device with a libxl__ev_child member Yang Hongyang
2014-09-24 14:53   ` Ian Jackson
2014-09-02  3:34 ` [PATCH v19 03/12] autoconf: add libnl3 dependency for Remus network buffering support Yang Hongyang
2014-09-02  3:34 ` [PATCH v19 04/12] libxl/remus: introduce an abstract Remus device layer Yang Hongyang
2014-09-24 15:30   ` Ian Jackson
2014-09-02  3:34 ` [PATCH v19 05/12] libxl/remus: setup and control network output buffering Yang Hongyang
2014-09-24 15:32   ` Ian Jackson
2014-09-02  3:34 ` [PATCH v19 06/12] libxl/remus: setup and control disk replication for DRBD backends Yang Hongyang
2014-09-05 17:41   ` Ian Jackson
2014-09-16 14:46     ` Ian Jackson
2014-09-16 15:13       ` Shriram Rajagopalan
2014-09-17  1:14       ` Hongyang Yang
2014-09-19 17:56         ` Ian Jackson
2014-09-23  5:13           ` Hongyang Yang
2014-09-24 15:32   ` Ian Jackson
2014-09-02  3:34 ` [PATCH v19 07/12] xl/remus: change bool to defbool Yang Hongyang
2014-09-24 15:37   ` Ian Jackson
2014-09-24 18:08     ` Shriram Rajagopalan
2014-09-02  3:34 ` [PATCH v19 08/12] xl/remus: cmdline switch to explicitly enable unsafe configurations Yang Hongyang
2014-09-24 15:39   ` Ian Jackson
2014-09-24 18:00     ` Shriram Rajagopalan
2014-09-25 10:23       ` Ian Campbell
2014-09-25 10:29         ` Ian Jackson
2014-09-25 11:30           ` Shriram Rajagopalan
2014-09-25 16:49             ` Ian Jackson
2014-09-02  3:34 ` [PATCH v19 09/12] xl/remus: cmdline switches and config vars to control network buffering Yang Hongyang
2014-09-24 15:41   ` Ian Jackson
2014-09-02  3:34 ` [PATCH v19 10/12] xl/remus: add a cmdline switch to disable disk replication Yang Hongyang
2014-09-24 15:42   ` Ian Jackson
2014-09-02  3:34 ` [PATCH v19 11/12] libxl/remus: add LIBXL_HAVE_REMUS to indicate Remus support in libxl Yang Hongyang
2014-09-24 15:42   ` Ian Jackson
2014-09-02  3:34 ` [PATCH v19 12/12] MAINTAINERS: update maintained files of Remus Yang Hongyang
2014-09-24 15:43   ` Ian Jackson
2014-09-25  1:34     ` Hongyang Yang
2014-09-25 10:23       ` Ian Campbell
2014-09-25 10:30         ` Hongyang Yang
2014-09-25 10:31           ` Ian Campbell
2014-09-25 13:11           ` Ian Jackson
2014-09-24 15:49 ` [PATCH v19 00/12] Remus/Libxl: Remus network buffering and drbd disk Ian Jackson
2014-09-25  6:25   ` Hongyang Yang
2014-09-25 10:28     ` Ian Jackson
2014-09-25 17:14     ` Ian Jackson
2014-09-26  6:12       ` 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=1409628880-22471-2-git-send-email-yanghy@cn.fujitsu.com \
    --to=yanghy@cn.fujitsu.com \
    --cc=andrew.cooper3@citrix.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 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).