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

[Xen-devel] [PATCH 1/7] introduce a new function libxl__remus_netbuf_setup_done()



We will exec some scripts to setup netbuf and disk, so we need two
asynchronous functions that are called when the setup 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  |    6 +++---
 tools/libxl/libxl_netbuffer.c |    4 ++--
 tools/libxl/libxl_remus.c     |   15 +++++++++++----
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 9ad0e27..3719bf4 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2454,9 +2454,9 @@ _hidden void domain_suspend_done(libxl__egc *egc,
                                  libxl__domain_suspend_state *dss,
                                  int rc);
 
-_hidden void libxl__remus_setup_done(libxl__egc *egc,
-                                     libxl__domain_suspend_state *dss,
-                                     int rc);
+_hidden void libxl__remus_netbuf_setup_done(libxl__egc *egc,
+                                            libxl__domain_suspend_state *dss,
+                                            int rc);
 
 _hidden void libxl__remus_netbuf_setup(libxl__egc *egc,
                                        libxl__domain_suspend_state *dss);
diff --git a/tools/libxl/libxl_netbuffer.c b/tools/libxl/libxl_netbuffer.c
index 22fffec..a596d31 100644
--- a/tools/libxl/libxl_netbuffer.c
+++ b/tools/libxl/libxl_netbuffer.c
@@ -413,7 +413,7 @@ static void netbuf_setup_script_cb(libxl__egc *egc,
 
     rc = init_qdiscs(gc, remus_state);
  out:
-    libxl__remus_setup_done(egc, remus_state->dss, rc);
+    libxl__remus_netbuf_setup_done(egc, remus_state->dss, rc);
 }
 
 /* Scan through the list of vifs belonging to domid and
@@ -454,7 +454,7 @@ void libxl__remus_netbuf_setup(libxl__egc *egc,
     return;
 
  out:
-    libxl__remus_setup_done(egc, dss, rc);
+    libxl__remus_netbuf_setup_done(egc, dss, rc);
 }
 
 static void netbuf_teardown_script_cb(libxl__egc *egc,
diff --git a/tools/libxl/libxl_remus.c b/tools/libxl/libxl_remus.c
index da303e7..ef90e6b 100644
--- a/tools/libxl/libxl_remus.c
+++ b/tools/libxl/libxl_remus.c
@@ -23,14 +23,14 @@ void libxl__remus_setup_initiate(libxl__egc *egc,
 {
     libxl__ev_time_init(&dss->remus_state->timeout);
     if (!dss->remus_state->netbufscript)
-        libxl__remus_setup_done(egc, dss, 0);
+        libxl__remus_netbuf_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)
+static void libxl__remus_setup_done(libxl__egc *egc,
+                                    libxl__domain_suspend_state *dss,
+                                    int rc)
 {
     STATE_AO_GC(dss->ao);
     if (!rc) {
@@ -43,6 +43,13 @@ void libxl__remus_setup_done(libxl__egc *egc,
     domain_suspend_done(egc, dss, rc);
 }
 
+void libxl__remus_netbuf_setup_done(libxl__egc *egc,
+                                    libxl__domain_suspend_state *dss,
+                                    int rc)
+{
+    libxl__remus_setup_done(egc, dss, rc);
+}
+
 void libxl__remus_teardown_initiate(libxl__egc *egc,
                                     libxl__domain_suspend_state *dss,
                                     int rc)
-- 
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®.