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

[Xen-changelog] Added the errno to the messages printed with the ERR macro. Tidy the use of



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 7acd50d945d7c22f336deaafbeb682a8aa503d5b
# Parent  4268d0ecdde7ed9f47604e66906f9baf79d48f0f
Added the errno to the messages printed with the ERR macro.  Tidy the use of
this macro where newlines have been appended -- the macro does this itself so
there is no need to add another one.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 4268d0ecdde7 -r 7acd50d945d7 tools/libxc/xc_linux_restore.c
--- a/tools/libxc/xc_linux_restore.c    Tue Nov 29 15:03:06 2005
+++ b/tools/libxc/xc_linux_restore.c    Wed Nov 30 18:38:14 2005
@@ -221,7 +221,7 @@
     
     if(xc_domain_memory_increase_reservation(
            xc_handle, dom, max_pfn, 0, 0, NULL) != 0) { 
-        ERR("Failed to increase reservation by %lx KB\n", PFN_TO_KB(max_pfn));
+        ERR("Failed to increase reservation by %lx KB", PFN_TO_KB(max_pfn));
         errno = ENOMEM;
         goto out;
     }
@@ -487,7 +487,7 @@
                 for(k = 0; k < j; k++) {
                     if(!uncanonicalize_pagetable(L1TAB, 
                                                  region_base + k*PAGE_SIZE)) {
-                        ERR("failed uncanonicalize pt!\n"); 
+                        ERR("failed uncanonicalize pt!"); 
                         goto out; 
                     } 
                 }
diff -r 4268d0ecdde7 -r 7acd50d945d7 tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c       Tue Nov 29 15:03:06 2005
+++ b/tools/libxc/xc_linux_save.c       Wed Nov 30 18:38:14 2005
@@ -523,13 +523,13 @@
 
     xmml.max_extents = m2p_chunks;
     if (!(xmml.extent_start = malloc(m2p_chunks * sizeof(unsigned long)))) { 
-        ERR("failed to allocate space for m2p mfns!\n"); 
+        ERR("failed to allocate space for m2p mfns"); 
         return NULL; 
     } 
 
     if (xc_memory_op(xc_handle, XENMEM_machphys_mfn_list, &xmml) ||
         (xmml.nr_extents != m2p_chunks)) {
-        ERR("xc_get_m2p_mfns:"); 
+        ERR("xc_get_m2p_mfns"); 
         return NULL;
     }
 
@@ -540,7 +540,7 @@
     } 
 
     if (!(entries = malloc(m2p_chunks * sizeof(privcmd_mmap_entry_t)))) { 
-        ERR("failed to allocate space for mmap entries!\n"); 
+        ERR("failed to allocate space for mmap entries"); 
         return NULL; 
     } 
 
@@ -794,7 +794,7 @@
     pfn_batch = calloc(MAX_BATCH_SIZE, sizeof(unsigned long));
 
     if ((pfn_type == NULL) || (pfn_batch == NULL)) {
-        ERR("failed to alloc memory for pfn_type and/or pfn_batch arays."); 
+        ERR("failed to alloc memory for pfn_type and/or pfn_batch arrays"); 
         errno = ENOMEM;
         goto out;
     }
diff -r 4268d0ecdde7 -r 7acd50d945d7 tools/libxc/xg_save_restore.h
--- a/tools/libxc/xg_save_restore.h     Tue Nov 29 15:03:06 2005
+++ b/tools/libxc/xg_save_restore.h     Wed Nov 30 18:38:14 2005
@@ -10,7 +10,7 @@
 #define PROGRESS 0
 
 #define ERR(_f, _a...) do {                     \
-    fprintf(stderr, _f "\n" , ## _a);           \
+    fprintf(stderr, _f ": %d\n" , ## _a, errno);\
     fflush(stderr); }                           \
 while (0)
 

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


 


Rackspace

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