libxc: rename safe_strerror to xc_strerror and pass in an XC handle for future use.
authorIan Campbell <ian.campbell@citrix.com>
Thu, 2 Dec 2010 12:49:00 +0000 (12:49 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 2 Dec 2010 12:49:00 +0000 (12:49 +0000)
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>

tools/libxc/ia64/xc_ia64_linux_save.c
tools/libxc/xc_private.c
tools/libxc/xc_private.h
tools/libxc/xenctrl.h

index 0584459321991df8c45d1d6f00456bdd7141d533..affc772b7c2ec7ea8f75d5dd8b962dca126d5ed8 100644 (file)
@@ -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;
                 }
 
index 1c7a5268e80e100775c22576b55f7c1151a8b739..32f181c7c442430f781648b91fba4cf82a509462 100644 (file)
@@ -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;
index e07a55b75d18d7083c8d0e85ea3ebca3240a15bb..f6c45f2e93edcfc59236825b7ebc97eb77f1de4f 100644 (file)
@@ -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
index f4dde880f83a00a92ee4115265de10e2206aa698..915410ac3a9e2d8b834c995b41402b0fab52f550 100644 (file)
@@ -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