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

[Xen-devel] [PATCH 2/7] introduce a new function libxl__remus_netbuf_teardown_done()



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 <laijs@xxxxxxxxxxxxxx>
Signed-off-by: Wen Congyang <wency@xxxxxxxxxxxxxx>
---
 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


_______________________________________________
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®.