All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH 3/6] libxl: add an xs_transaction_t parameter to two libxl functions
Date: Tue, 27 Mar 2012 14:59:29 +0100	[thread overview]
Message-ID: <1332856772-30292-3-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1203271453390.15151@kaball-desktop>

Add an additional xs_transaction_t parameter to
libxl__device_disk_from_xs_be and libxl__append_disk_list_of_type.

Update all the callers.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 tools/libxl/libxl.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index d33fbdf..ce5e7be 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1432,6 +1432,7 @@ out:
 }
 
 static void libxl__device_disk_from_xs_be(libxl__gc *gc,
+                                          xs_transaction_t t,
                                           const char *be_path,
                                           libxl_device_disk *disk)
 {
@@ -1441,7 +1442,7 @@ static void libxl__device_disk_from_xs_be(libxl__gc *gc,
 
     libxl_device_disk_init(disk);
 
-    tmp = xs_read(ctx->xsh, XBT_NULL,
+    tmp = xs_read(ctx->xsh, t,
                   libxl__sprintf(gc, "%s/params", be_path), &len);
     if (tmp && strchr(tmp, ':')) {
         disk->pdev_path = strdup(strchr(tmp, ':') + 1);
@@ -1450,12 +1451,12 @@ static void libxl__device_disk_from_xs_be(libxl__gc *gc,
         disk->pdev_path = tmp;
     }
     libxl_string_to_backend(ctx,
-                        libxl__xs_read(gc, XBT_NULL,
+                        libxl__xs_read(gc, t,
                                        libxl__sprintf(gc, "%s/type", be_path)),
                         &(disk->backend));
-    disk->vdev = xs_read(ctx->xsh, XBT_NULL,
+    disk->vdev = xs_read(ctx->xsh, t,
                          libxl__sprintf(gc, "%s/dev", be_path), &len);
-    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf
+    tmp = libxl__xs_read(gc, t, libxl__sprintf
                          (gc, "%s/removable", be_path));
 
     if (tmp)
@@ -1463,13 +1464,13 @@ static void libxl__device_disk_from_xs_be(libxl__gc *gc,
     else
         disk->removable = 0;
 
-    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
+    tmp = libxl__xs_read(gc, t, libxl__sprintf(gc, "%s/mode", be_path));
     if (!strcmp(tmp, "w"))
         disk->readwrite = 1;
     else
         disk->readwrite = 0;
 
-    tmp = libxl__xs_read(gc, XBT_NULL,
+    tmp = libxl__xs_read(gc, t,
                          libxl__sprintf(gc, "%s/device-type", be_path));
     disk->is_cdrom = !strcmp(tmp, "cdrom");
 
@@ -1499,7 +1500,7 @@ int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
     if (!path)
         goto out;
 
-    libxl__device_disk_from_xs_be(gc, path, disk);
+    libxl__device_disk_from_xs_be(gc, XBT_NULL, path, disk);
 
     rc = 0;
 out:
@@ -1510,6 +1511,7 @@ out:
 
 static int libxl__append_disk_list_of_type(libxl__gc *gc,
                                            uint32_t domid,
+                                           xs_transaction_t t,
                                            const char *type,
                                            libxl_device_disk **disks,
                                            int *ndisks)
@@ -1521,7 +1523,7 @@ static int libxl__append_disk_list_of_type(libxl__gc *gc,
 
     be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
-    dir = libxl__xs_directory(gc, XBT_NULL, be_path, &n);
+    dir = libxl__xs_directory(gc, t, be_path, &n);
     if (dir) {
         libxl_device_disk *tmp;
         tmp = realloc(*disks, sizeof (libxl_device_disk) * (*ndisks + n));
@@ -1534,7 +1536,7 @@ static int libxl__append_disk_list_of_type(libxl__gc *gc,
         for (; pdisk < pdisk_end; pdisk++, dir++) {
             const char *p;
             p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
-            libxl__device_disk_from_xs_be(gc, p, pdisk);
+            libxl__device_disk_from_xs_be(gc, t, p, pdisk);
             pdisk->backend_domid = 0;
         }
     }
@@ -1549,13 +1551,13 @@ libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx, uint32_t domid, int *n
 
     *num = 0;
 
-    rc = libxl__append_disk_list_of_type(gc, domid, "vbd", &disks, num);
+    rc = libxl__append_disk_list_of_type(gc, domid, XBT_NULL, "vbd", &disks, num);
     if (rc) goto out_err;
 
-    rc = libxl__append_disk_list_of_type(gc, domid, "tap", &disks, num);
+    rc = libxl__append_disk_list_of_type(gc, domid, XBT_NULL, "tap", &disks, num);
     if (rc) goto out_err;
 
-    rc = libxl__append_disk_list_of_type(gc, domid, "qdisk", &disks, num);
+    rc = libxl__append_disk_list_of_type(gc, domid, XBT_NULL, "qdisk", &disks, num);
     if (rc) goto out_err;
 
     GC_FREE;
-- 
1.7.2.5

  parent reply	other threads:[~2012-03-27 13:59 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 13:58 [PATCH 0/6] qdisk local attach Stefano Stabellini
2012-03-27 13:59 ` [PATCH 1/6] libxl: libxl_device_disk_local_attach return a new libxl_device_disk Stefano Stabellini
2012-03-27 14:07   ` Ian Campbell
2012-03-30 10:42     ` Stefano Stabellini
2012-03-27 16:21   ` Ian Jackson
2012-03-30 10:43     ` Stefano Stabellini
2012-03-27 13:59 ` [PATCH 2/6] libxl: introduce libxl__device_generic_add_t Stefano Stabellini
2012-03-27 14:04   ` Ian Campbell
2012-03-30 10:44     ` Stefano Stabellini
2012-03-27 16:50   ` Ian Jackson
2012-03-30 10:46     ` Stefano Stabellini
2012-04-02 16:18       ` Ian Jackson
2012-04-03 12:03         ` Stefano Stabellini
2012-03-27 13:59 ` Stefano Stabellini [this message]
2012-03-27 14:17   ` [PATCH 3/6] libxl: add an xs_transaction_t parameter to two libxl functions Ian Campbell
2012-03-27 16:50   ` Ian Jackson
2012-03-27 13:59 ` [PATCH 4/6] libxl: introduce libxl__device_disk_add_t Stefano Stabellini
2012-03-27 13:59 ` [PATCH 5/6] libxl: introduce libxl__alloc_vdev Stefano Stabellini
2012-03-27 14:21   ` Ian Campbell
2012-03-27 17:21     ` Ian Jackson
2012-03-30 11:43     ` Stefano Stabellini
2012-03-30 12:14       ` Ian Campbell
2012-03-30 12:57         ` Stefano Stabellini
2012-03-27 17:19   ` Ian Jackson
2012-03-30 11:57     ` Stefano Stabellini
2012-03-30 14:17       ` Ian Jackson
2012-03-30 15:23         ` Stefano Stabellini
2012-04-02 16:15           ` Ian Jackson
2012-04-03 13:15             ` Stefano Stabellini
2012-04-03 13:17               ` Ian Jackson
2012-04-03 14:19                 ` Stefano Stabellini
2012-04-03 14:24                   ` Ian Jackson
2012-04-10 17:37                     ` Stefano Stabellini
2012-04-11 15:49                       ` Stefano Stabellini
2012-03-27 13:59 ` [PATCH 6/6] xl/libxl: implement QDISK libxl_device_disk_local_attach Stefano Stabellini
2012-03-27 17:20   ` Ian Jackson
2012-03-30 10:50     ` Stefano Stabellini
2012-03-30 13:47       ` Ian Jackson
2012-03-30 14:55         ` Stefano Stabellini

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=1332856772-30292-3-git-send-email-stefano.stabellini@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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.