From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lai Jiangshan Subject: [PATCH 2/7] introduce a new function libxl__remus_netbuf_teardown_done() Date: Thu, 3 Apr 2014 20:22:34 +0800 Message-ID: <1396527759-10186-2-git-send-email-laijs@cn.fujitsu.com> References: <1396436677-10872-9-git-send-email-yanghy@cn.fujitsu.com> <1396527759-10186-1-git-send-email-laijs@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1396527759-10186-1-git-send-email-laijs@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 , FNST-Wen Congyang , Stefano Stabellini , Andrew Cooper , Jiang Yunhong , Ian Jackson , Lai Jiangshan , Dong Eddie , Shriram Rajagopalan , FNST-Yang Hongyang , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org We will exec some scripts to teardown netbuf and disk, so we need two asynchronous functions that are called when the teardown is done. This patch introduces the asynchronous function for netbuf. Signed-off-by: Lai Jiangshan Signed-off-by: Wen Congyang --- tools/libxl/libxl_internal.h | 4 ++-- tools/libxl/libxl_netbuffer.c | 4 ++-- tools/libxl/libxl_remus.c | 12 +++++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 3719bf4..dc49f16 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -2461,8 +2461,8 @@ _hidden void libxl__remus_netbuf_setup_done(libxl__egc *egc, _hidden void libxl__remus_netbuf_setup(libxl__egc *egc, libxl__domain_suspend_state *dss); -_hidden void libxl__remus_teardown_done(libxl__egc *egc, - libxl__domain_suspend_state *dss); +_hidden void libxl__remus_netbuf_teardown_done(libxl__egc *egc, + libxl__domain_suspend_state *dss); _hidden void libxl__remus_netbuf_teardown(libxl__egc *egc, libxl__domain_suspend_state *dss); diff --git a/tools/libxl/libxl_netbuffer.c b/tools/libxl/libxl_netbuffer.c index a596d31..c9c1ba7 100644 --- a/tools/libxl/libxl_netbuffer.c +++ b/tools/libxl/libxl_netbuffer.c @@ -485,7 +485,7 @@ static void netbuf_teardown_script_cb(libxl__egc *egc, } out: - libxl__remus_teardown_done(egc, remus_state->dss); + libxl__remus_netbuf_teardown_done(egc, remus_state->dss); } /* Note: This function will be called in the same gc context as @@ -506,7 +506,7 @@ void libxl__remus_netbuf_teardown(libxl__egc *egc, remus_state->dev_id = 0; if (exec_netbuf_script(gc, remus_state, "teardown", netbuf_teardown_script_cb)) - libxl__remus_teardown_done(egc, dss); + libxl__remus_netbuf_teardown_done(egc, dss); } /* The buffer_op's value, not the value passed to kernel */ diff --git a/tools/libxl/libxl_remus.c b/tools/libxl/libxl_remus.c index ef90e6b..78652d2 100644 --- a/tools/libxl/libxl_remus.c +++ b/tools/libxl/libxl_remus.c @@ -58,13 +58,19 @@ void libxl__remus_teardown_initiate(libxl__egc *egc, dss->remus_state->saved_rc = rc; if (!dss->remus_state->netbuf_state) - libxl__remus_teardown_done(egc, dss); + libxl__remus_netbuf_teardown_done(egc, dss); else libxl__remus_netbuf_teardown(egc, dss); } -void libxl__remus_teardown_done(libxl__egc *egc, - libxl__domain_suspend_state *dss) +static void libxl__remus_teardown_done(libxl__egc *egc, + libxl__domain_suspend_state *dss) { dss->callback(egc, dss, dss->remus_state->saved_rc); } + +void libxl__remus_netbuf_teardown_done(libxl__egc *egc, + libxl__domain_suspend_state *dss) +{ + libxl__remus_teardown_done(egc, dss); +} -- 1.7.4.4