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

[Xen-devel] [PATCH 1 of 2] libxc: rename safe_strerror to xc_strerror and pass in an XC handle for future use



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1291294140 0
# Node ID 09bd65d842658b39e584b1d4bbc08e9813813937
# Parent  74b5822000a8f1d597f765c8d0a243e095de2f22
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>

diff -r 74b5822000a8 -r 09bd65d84265 tools/libxc/ia64/xc_ia64_linux_save.c
--- a/tools/libxc/ia64/xc_ia64_linux_save.c     Thu Dec 02 12:49:00 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 74b5822000a8 -r 09bd65d84265 tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c  Thu Dec 02 12:49:00 2010 +0000
+++ b/tools/libxc/xc_private.c  Thu Dec 02 12:49:00 2010 +0000
@@ -543,7 +543,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 74b5822000a8 -r 09bd65d84265 tools/libxc/xc_private.h
--- a/tools/libxc/xc_private.h  Thu Dec 02 12:49:00 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 74b5822000a8 -r 09bd65d84265 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h     Thu Dec 02 12:49:00 2010 +0000
+++ b/tools/libxc/xenctrl.h     Thu Dec 02 12:49:00 2010 +0000
@@ -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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.