From: Yang Hongyang Subject: [PATCH v18 02/11] libxl: add support for async. function calls when using libxl__ao_device Date: Mon, 28 Jul 2014 17:23:56 +0800 Message-ID: <1406539445-12708-3-git-send-email-yanghy@cn.fujitsu.com> References: <1406539445-12708-1-git-send-email-yanghy@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1406539445-12708-1-git-send-email-yanghy@cn.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org 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 List-Id: xen-devel@lists.xenproject.org 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 Signed-off-by: Shriram Rajagopalan --- 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