From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [PATCH 3/3] libxl: save/restore callbacks: enforce a useful errno value Date: Mon, 22 Sep 2014 14:58:19 +0100 Message-ID: <1411394299-8584-3-git-send-email-ian.jackson@eu.citrix.com> References: <21536.10963.947982.42738@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21536.10963.947982.42738@mariner.uk.xensource.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.xensource.com Cc: olaf@aepfle.de, Ian.Campbell@citrix.com, wency@cn.fujitsu.com, Ian Jackson , yunhong.jiang@intel.com, eddie.dong@intel.com, yanghy@cn.fujitsu.com, laijs@cn.fujitsu.com List-Id: xen-devel@lists.xenproject.org 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 --- 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