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

[Xen-devel] [PATCH 3/3] libxl: save/restore callbacks: enforce a useful errno value



libxl__xc_domain_saverestore_async_callback_done now no longer assumes
that the caller has set errno.  Instead, it takes a new parameter
containing the errno value.

For one of the call sites it is obvious what value should be passed.

All the others have been left untouched.  As a result the code now
DOES NOT COMPILE.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_dom.c          |    2 +-
 tools/libxl/libxl_internal.h     |    3 ++-
 tools/libxl/libxl_save_callout.c |    4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index c944804..f418566 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -952,7 +952,7 @@ static void domain_suspend_switch_qemu_xen_logdirty
 
     rc = libxl__qmp_set_global_dirty_log(gc, domid, enable);
     if (!rc) {
-        libxl__xc_domain_saverestore_async_callback_done(egc, shs, 0);
+        libxl__xc_domain_saverestore_async_callback_done(egc, shs, 0,0);
     } else {
         LOG(ERROR,"logdirty switch failed (rc=%d), aborting suspend",rc);
         libxl__xc_domain_saverestore_async_callback_done(egc, shs, -1);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 04c9378..891ea7a 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2804,7 +2804,8 @@ _hidden void libxl__xc_domain_save_done(libxl__egc*, void 
*dss_void,
  * Such functions' actual callback function return void in libxl
  * When they are ready to indicate completion, they call this. */
 void libxl__xc_domain_saverestore_async_callback_done(libxl__egc *egc,
-                           libxl__save_helper_state *shs, int return_value);
+                           libxl__save_helper_state *shs,
+                           int return_value, int errnoval);
 
 
 _hidden void libxl__domain_suspend_common_switch_qemu_logdirty
diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c
index 88b406b..b7cbfe8 100644
--- a/tools/libxl/libxl_save_callout.c
+++ b/tools/libxl/libxl_save_callout.c
@@ -139,10 +139,10 @@ void libxl__xc_domain_save(libxl__egc *egc, 
libxl__domain_suspend_state *dss)
 
 void libxl__xc_domain_saverestore_async_callback_done(libxl__egc *egc,
                            libxl__save_helper_state *shs,
-                           int return_value)
+                           int return_value, int errnoval)
 {
     shs->egc = egc;
-    libxl__srm_callout_sendreply(return_value, errno, shs);
+    libxl__srm_callout_sendreply(return_value, errnoval, shs);
     shs->egc = 0;
 }
 
-- 
1.7.10.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®.