ia64/xen-unstable

changeset 8138:7acd50d945d7

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@xensource.com>
author emellor@leeni.uk.xensource.com
date Wed Nov 30 18:38:14 2005 +0000 (2005-11-30)
parents 4268d0ecdde7
children 341c56e34b0d
files tools/libxc/xc_linux_restore.c tools/libxc/xc_linux_save.c tools/libxc/xg_save_restore.h
line diff
     1.1 --- a/tools/libxc/xc_linux_restore.c	Tue Nov 29 16:03:06 2005 +0100
     1.2 +++ b/tools/libxc/xc_linux_restore.c	Wed Nov 30 18:38:14 2005 +0000
     1.3 @@ -221,7 +221,7 @@ int xc_linux_restore(int xc_handle, int 
     1.4      
     1.5      if(xc_domain_memory_increase_reservation(
     1.6             xc_handle, dom, max_pfn, 0, 0, NULL) != 0) { 
     1.7 -        ERR("Failed to increase reservation by %lx KB\n", PFN_TO_KB(max_pfn));
     1.8 +        ERR("Failed to increase reservation by %lx KB", PFN_TO_KB(max_pfn));
     1.9          errno = ENOMEM;
    1.10          goto out;
    1.11      }
    1.12 @@ -487,7 +487,7 @@ int xc_linux_restore(int xc_handle, int 
    1.13                  for(k = 0; k < j; k++) {
    1.14                      if(!uncanonicalize_pagetable(L1TAB, 
    1.15                                                   region_base + k*PAGE_SIZE)) {
    1.16 -                        ERR("failed uncanonicalize pt!\n"); 
    1.17 +                        ERR("failed uncanonicalize pt!"); 
    1.18                          goto out; 
    1.19                      } 
    1.20                  }
     2.1 --- a/tools/libxc/xc_linux_save.c	Tue Nov 29 16:03:06 2005 +0100
     2.2 +++ b/tools/libxc/xc_linux_save.c	Wed Nov 30 18:38:14 2005 +0000
     2.3 @@ -523,13 +523,13 @@ static unsigned long *xc_map_m2p(int xc_
     2.4  
     2.5      xmml.max_extents = m2p_chunks;
     2.6      if (!(xmml.extent_start = malloc(m2p_chunks * sizeof(unsigned long)))) { 
     2.7 -        ERR("failed to allocate space for m2p mfns!\n"); 
     2.8 +        ERR("failed to allocate space for m2p mfns"); 
     2.9          return NULL; 
    2.10      } 
    2.11  
    2.12      if (xc_memory_op(xc_handle, XENMEM_machphys_mfn_list, &xmml) ||
    2.13          (xmml.nr_extents != m2p_chunks)) {
    2.14 -        ERR("xc_get_m2p_mfns:"); 
    2.15 +        ERR("xc_get_m2p_mfns"); 
    2.16          return NULL;
    2.17      }
    2.18  
    2.19 @@ -540,7 +540,7 @@ static unsigned long *xc_map_m2p(int xc_
    2.20      } 
    2.21  
    2.22      if (!(entries = malloc(m2p_chunks * sizeof(privcmd_mmap_entry_t)))) { 
    2.23 -        ERR("failed to allocate space for mmap entries!\n"); 
    2.24 +        ERR("failed to allocate space for mmap entries"); 
    2.25          return NULL; 
    2.26      } 
    2.27  
    2.28 @@ -794,7 +794,7 @@ int xc_linux_save(int xc_handle, int io_
    2.29      pfn_batch = calloc(MAX_BATCH_SIZE, sizeof(unsigned long));
    2.30  
    2.31      if ((pfn_type == NULL) || (pfn_batch == NULL)) {
    2.32 -        ERR("failed to alloc memory for pfn_type and/or pfn_batch arays."); 
    2.33 +        ERR("failed to alloc memory for pfn_type and/or pfn_batch arrays"); 
    2.34          errno = ENOMEM;
    2.35          goto out;
    2.36      }
     3.1 --- a/tools/libxc/xg_save_restore.h	Tue Nov 29 16:03:06 2005 +0100
     3.2 +++ b/tools/libxc/xg_save_restore.h	Wed Nov 30 18:38:14 2005 +0000
     3.3 @@ -10,7 +10,7 @@
     3.4  #define PROGRESS 0
     3.5  
     3.6  #define ERR(_f, _a...) do {                     \
     3.7 -    fprintf(stderr, _f "\n" , ## _a);           \
     3.8 +    fprintf(stderr, _f ": %d\n" , ## _a, errno);\
     3.9      fflush(stderr); }                           \
    3.10  while (0)
    3.11