From: Lai Jiangshan Subject: [PATCH 09/13 V6] remus: use the API to setup network buffering Date: Tue, 21 Jan 2014 17:05:13 +0800 Message-ID: <1390295117-718-10-git-send-email-laijs@cn.fujitsu.com> References: <1390295117-718-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: <1390295117-718-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 , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org From: Shriram Rajagopalan If there is network buffering hotplug scripts, call libxl__remus_netbuf_setup() to setup the network buffering. Signed-off-by: Shriram Rajagopalan Signed-off-by: Lai Jiangshan Reviewed-by: Wen Congyang --- tools/libxl/libxl.c | 2 +- tools/libxl/libxl_internal.h | 3 +++ tools/libxl/libxl_remus.c | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 026206a..f45fd74 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -762,7 +762,7 @@ int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info, } /* Point of no return */ - libxl__domain_suspend(egc, dss); + libxl__remus_setup_initiate(egc, dss); return AO_INPROGRESS; out: diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 358590b..657cfc4 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -2336,6 +2336,9 @@ _hidden void libxl__remus_teardown_done(libxl__egc *egc, _hidden void libxl__remus_netbuf_teardown(libxl__egc *egc, libxl__domain_suspend_state *dss); +_hidden void libxl__remus_setup_initiate(libxl__egc *egc, + libxl__domain_suspend_state *dss); + struct libxl__domain_suspend_state { /* set by caller of libxl__domain_suspend */ libxl__ao *ao; diff --git a/tools/libxl/libxl_remus.c b/tools/libxl/libxl_remus.c index 6790c61..38776e1 100644 --- a/tools/libxl/libxl_remus.c +++ b/tools/libxl/libxl_remus.c @@ -19,6 +19,16 @@ /*----- remus setup/teardown code -----*/ +void libxl__remus_setup_initiate(libxl__egc *egc, + libxl__domain_suspend_state *dss) +{ + libxl__ev_time_init(&dss->remus_state->timeout); + if (!dss->remus_state->netbufscript) + libxl__remus_setup_done(egc, dss, 0); + else + libxl__remus_netbuf_setup(egc, dss); +} + void libxl__remus_setup_done(libxl__egc *egc, libxl__domain_suspend_state *dss, int rc) -- 1.8.4.2