# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1291294140 0
# Node ID 31c2ae4ecd58684c12a2239e3a4fb8413e168c48
# Parent ea4d24457d91eaeef715e8169c86a5d7ee0f1bde
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@xxxxxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
committer: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
tools/libxc/ia64/xc_ia64_linux_save.c | 2 +-
tools/libxc/xc_private.c | 2 +-
tools/libxc/xc_private.h | 3 +--
tools/libxc/xenctrl.h | 5 +++++
4 files changed, 8 insertions(+), 4 deletions(-)
diff -r ea4d24457d91 -r 31c2ae4ecd58 tools/libxc/ia64/xc_ia64_linux_save.c
--- a/tools/libxc/ia64/xc_ia64_linux_save.c Thu Dec 02 12:33:01 2010 +0000
+++ b/tools/libxc/ia64/xc_ia64_linux_save.c Thu Dec 02 12:49:00 2010 +0000
@@ -660,7 +660,7 @@ xc_domain_save(xc_interface *xch, int io
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 -r ea4d24457d91 -r 31c2ae4ecd58 tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c Thu Dec 02 12:33:01 2010 +0000
+++ b/tools/libxc/xc_private.c Thu Dec 02 12:49:00 2010 +0000
@@ -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 -r ea4d24457d91 -r 31c2ae4ecd58 tools/libxc/xc_private.h
--- a/tools/libxc/xc_private.h Thu Dec 02 12:33:01 2010 +0000
+++ b/tools/libxc/xc_private.h Thu Dec 02 12:49:00 2010 +0000
@@ -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_interfac
#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 -r ea4d24457d91 -r 31c2ae4ecd58 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h Thu Dec 02 12:33:01 2010 +0000
+++ b/tools/libxc/xenctrl.h Thu Dec 02 12:49:00 2010 +0000
@@ -1410,6 +1410,11 @@ typedef struct xc_error {
* Do not fail, but return pointers to generic strings if fed bogus input.
*/
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);
/*
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|