[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v18 02/11] libxl: add support for async. function calls when using libxl__ao_device



Extend libxl__ao_device with a libxl__ev_child member, which can be
used to asynchronously execute functions that take a long time to complete.
Remus uses this functionality to execute functions that involve blocking
system calls.

Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
Signed-off-by: Shriram Rajagopalan <rshriram@xxxxxxxxx>
---
 tools/libxl/libxl_device.c   | 1 +
 tools/libxl/libxl_internal.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 9180732..89dc824 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -435,6 +435,7 @@ void libxl__prepare_ao_device(libxl__ao *ao, 
libxl__ao_device *aodev)
     /* We init this here because we might call device_hotplug_done
      * without actually calling any hotplug script */
     libxl__async_exec_init(&aodev->aes);
+    libxl__ev_child_init(&aodev->child);
 }
 
 /* multidev */
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 611b9fb..4bc042b 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2128,6 +2128,8 @@ struct libxl__ao_device {
     int num_exec;
     /* for calling hotplug scripts */
     libxl__async_exec_state aes;
+    /* for executing functions asynchronously */
+    libxl__ev_child child;
 };
 
 /*
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.