From: Ian Jackson Date: Tue, 11 Jan 2011 16:48:09 +0000 (+0000) Subject: tools/xenpaging: fix return value from xc_mem_paging_flush_ioemu_cache X-Git-Tag: 4.1.0-rc1~22 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=07b597fbbb22d946833e00342df43a29b76ffc7e;p=people%2Fvhanquez%2Fxen-unstable.git tools/xenpaging: fix return value from xc_mem_paging_flush_ioemu_cache While using xenpaging, "Error flushing ioemu cache" message will be shown even if the "flush-cache" command is sent to xenstore correctly. That is because xenpaging assumes xc_mem_paging_flush_ioemu_cache() returns non-zero value when the operation fails. But xc_mem_paging_flush_ioemu_cache() returns the return value from xs_write() which is zero on error. So, we should invert the return value from xs_write() and return -1 on error, or 0 on success, like other xc_ functions. Signed-off-by: Han-Lin Li Author: Olaf Hering Signed-off-by: Ian Jackson Committed-by: Ian Jackson --- diff --git a/tools/xenpaging/xc.c b/tools/xenpaging/xc.c index d1a62ff77f..d1dcb6847f 100644 --- a/tools/xenpaging/xc.c +++ b/tools/xenpaging/xc.c @@ -62,7 +62,7 @@ int xc_mem_paging_flush_ioemu_cache(domid_t domain_id) xs_daemon_close(xsh); - return rc; + return rc ? 0 : -1; } int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms)