aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl.c
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@citrix.com>2012-07-26 16:47:37 +0100
committerRoger Pau Monne <roger.pau@citrix.com>2012-07-26 16:47:37 +0100
commitd82a726d153bdd9de98cdab27ed2f4e1d8eb47a1 (patch)
tree2d140c1b487034b7fd5ec1d962e7f5416b0d4cc4 /tools/libxl/libxl.c
parent2c5f57a30850ba8f6371222bcf14be9b8a747de8 (diff)
downloadxen-d82a726d153bdd9de98cdab27ed2f4e1d8eb47a1.tar.gz
xen-d82a726d153bdd9de98cdab27ed2f4e1d8eb47a1.tar.bz2
xen-d82a726d153bdd9de98cdab27ed2f4e1d8eb47a1.zip
libxl: convert libxl_device_vfb_add to an async operation
Split libxl_device_vfb_add into libxl__device_vfb_add (to be used inside already running ao's), and make libxl_device_vfb_add a stub to call libxl__device_vfb_add. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl.c')
-rw-r--r--tools/libxl/libxl.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 5a2c6e1974..00ddc0ec80 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3019,9 +3019,25 @@ static int libxl__device_from_vfb(libxl__gc *gc, uint32_t domid,
return 0;
}
-int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb)
+int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb,
+ const libxl_asyncop_how *ao_how)
+{
+ AO_CREATE(ctx, domid, ao_how);
+ int rc;
+
+ rc = libxl__device_vfb_add(gc, domid, vfb);
+ if (rc) {
+ LOG(ERROR, "unable to add vfb device");
+ goto out;
+ }
+
+out:
+ libxl__ao_complete(egc, ao, rc);
+ return AO_INPROGRESS;
+}
+
+int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid, libxl_device_vfb *vfb)
{
- GC_INIT(ctx);
flexarray_t *front;
flexarray_t *back;
libxl__device device;
@@ -3079,7 +3095,6 @@ out_free:
flexarray_free(front);
flexarray_free(back);
out:
- GC_FREE;
return rc;
}