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 v8 05/11] libxl: introduce libxl__device_disk_add
Date: Tue, 29 May 2012 11:39:10 +0100 [thread overview]
Message-ID: <1338287956-24691-5-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1205281439080.26786@kaball-desktop>
Introduce libxl__device_disk_add that takes an additional
xs_transaction_t paramter.
Implement libxl_device_disk_add using libxl__device_disk_add.
Changes in v7:
- implement libxl__device_disk_add in libxl.c.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
tools/libxl/libxl.c | 14 +++++++++++---
tools/libxl/libxl_internal.h | 2 ++
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index eb1ad4f..8d128a6 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1367,14 +1367,15 @@ int libxl__device_from_disk(libxl__gc *gc, uint32_t domid,
return 0;
}
-int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk)
+int libxl__device_disk_add(libxl__gc *gc, uint32_t domid,
+ xs_transaction_t t, libxl_device_disk *disk)
{
- GC_INIT(ctx);
flexarray_t *front;
flexarray_t *back;
char *dev;
libxl__device device;
int major, minor, rc;
+ libxl_ctx *ctx = gc->owner;
rc = libxl__device_disk_setdefault(gc, disk);
if (rc) goto out;
@@ -1472,7 +1473,7 @@ int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *dis
flexarray_append(front, "device-type");
flexarray_append(front, disk->is_cdrom ? "cdrom" : "disk");
- libxl__device_generic_add(gc, XBT_NULL, &device,
+ libxl__device_generic_add(gc, t, &device,
libxl__xs_kvs_of_flexarray(gc, back, back->count),
libxl__xs_kvs_of_flexarray(gc, front, front->count));
@@ -1482,6 +1483,13 @@ out_free:
flexarray_free(back);
flexarray_free(front);
out:
+ return rc;
+}
+
+int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk)
+{
+ GC_INIT(ctx);
+ int rc = libxl__device_disk_add(gc, domid, XBT_NULL, disk);
GC_FREE;
return rc;
}
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 32eb09c..b917553 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1263,6 +1263,8 @@ _hidden void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path);
_hidden int libxl__device_from_disk(libxl__gc *gc, uint32_t domid,
libxl_device_disk *disk,
libxl__device *device);
+_hidden int libxl__device_disk_add(libxl__gc *gc, uint32_t domid,
+ xs_transaction_t t, libxl_device_disk *disk);
/*
* Make a disk available in this (the control) domain. Returns path to
--
1.7.2.5
next prev parent reply other threads:[~2012-05-29 10:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-29 10:38 [PATCH v8 0/11] qdisk local attach Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 01/11] libxl: make libxl_device_disk_local_attach/detach internal functions Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 02/11] libxl: libxl__device_disk_local_attach return a new libxl_device_disk Stefano Stabellini
2012-05-29 14:10 ` Ian Campbell
2012-05-29 14:29 ` Stefano Stabellini
2012-05-29 14:48 ` Stefano Stabellini
2012-05-29 15:03 ` Ian Campbell
2012-05-29 15:10 ` Stefano Stabellini
2012-05-29 15:23 ` Ian Jackson
2012-05-29 15:25 ` Ian Jackson
2012-05-29 15:32 ` Ian Campbell
2012-05-29 10:39 ` [PATCH v8 03/11] libxl: add a transaction parameter to libxl__device_generic_add Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 04/11] libxl: export libxl__device_from_disk Stefano Stabellini
2012-05-29 10:39 ` Stefano Stabellini [this message]
2012-05-29 10:39 ` [PATCH v8 06/11] xl/libxl: add a blkdev_start parameter Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 07/11] libxl: introduce libxl__alloc_vdev Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 08/11] xl/libxl: implement QDISK libxl_device_disk_local_attach Stefano Stabellini
2012-06-07 17:56 ` Roger Pau Monne
2012-06-07 18:27 ` Ian Jackson
2012-05-29 10:39 ` [PATCH v8 09/11] libxl__device_disk_local_attach: wait for state "connected" Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 10/11] libxl_string_to_backend: add qdisk Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 11/11] main_blockdetach: destroy the disk on successful removal Stefano Stabellini
2012-05-29 15:37 ` [PATCH v8 0/11] qdisk local attach Ian Campbell
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=1338287956-24691-5-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 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).