diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-12-02 12:49:00 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2010-12-02 12:49:00 +0000 |
commit | 0bba6abe9863fabeae156b2361e531dac5afd93d (patch) | |
tree | 97d7a8318713393ab492a4af94c208272f8ad866 | |
parent | 77fcd869a7beb55857198b8d6cbffe63b33cac20 (diff) | |
download | xen-0bba6abe9863fabeae156b2361e531dac5afd93d.tar.gz xen-0bba6abe9863fabeae156b2361e531dac5afd93d.tar.bz2 xen-0bba6abe9863fabeae156b2361e531dac5afd93d.zip |
libxc: rename safe_strerror to xc_strerror and pass in an XC handle for future use.
Make the function public since I have future patches which depend on this.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
-rw-r--r-- | tools/libxc/ia64/xc_ia64_linux_save.c | 2 | ||||
-rw-r--r-- | tools/libxc/xc_private.c | 2 | ||||
-rw-r--r-- | tools/libxc/xc_private.h | 3 | ||||
-rw-r--r-- | tools/libxc/xenctrl.h | 5 |
4 files changed, 8 insertions, 4 deletions
diff --git a/tools/libxc/ia64/xc_ia64_linux_save.c b/tools/libxc/ia64/xc_ia64_linux_save.c index 0584459321..affc772b7c 100644 --- a/tools/libxc/ia64/xc_ia64_linux_save.c +++ b/tools/libxc/ia64/xc_ia64_linux_save.c @@ -660,7 +660,7 @@ xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters, FIXME: to be tracked. */ fprintf(stderr, "cannot map mfn page %lx gpfn %lx: %s\n", xc_ia64_p2m_mfn(&p2m_table, N), - N, safe_strerror(errno)); + N, xc_strerror(xch, errno)); goto out; } diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index 1c7a5268e8..32f181c7c4 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -544,7 +544,7 @@ _xc_init_errbuf(void) pthread_key_create(&errbuf_pkey, _xc_clean_errbuf); } -char *safe_strerror(int errcode) +const char *xc_strerror(xc_interface *xch, int errcode) { #define XS_BUFSIZE 32 char *errbuf; diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h index e07a55b75d..f6c45f2e93 100644 --- a/tools/libxc/xc_private.h +++ b/tools/libxc/xc_private.h @@ -74,7 +74,6 @@ struct xc_interface { const char *currently_progress_reporting; }; -char *safe_strerror(int errcode); void xc_report_error(xc_interface *xch, int code, const char *fmt, ...); void xc_reportv(xc_interface *xch, xentoollog_logger *lg, xentoollog_level, int code, const char *fmt, va_list args) @@ -96,7 +95,7 @@ void xc_report_progress_step(xc_interface *xch, #define ERROR(_m, _a...) xc_report_error(xch,XC_INTERNAL_ERROR,_m , ## _a ) #define PERROR(_m, _a...) xc_report_error(xch,XC_INTERNAL_ERROR,_m \ - " (%d = %s)", ## _a , errno, safe_strerror(errno)) + " (%d = %s)", ## _a , errno, xc_strerror(xch, errno)) /* * HYPERCALL ARGUMENT BUFFERS diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h index f4dde880f8..915410ac3a 100644 --- a/tools/libxc/xenctrl.h +++ b/tools/libxc/xenctrl.h @@ -1411,6 +1411,11 @@ typedef struct xc_error { */ const char *xc_error_code_to_desc(int code); +/* + * Convert an errno value to a text description. + */ +const char *xc_strerror(xc_interface *xch, int errcode); + /* * Return a pointer to the last error with level XC_REPORT_ERROR. This |