ia64/xen-unstable
changeset 12212:96f51a000ed0
Print errno for each of the "Error when writing to state file" messages.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
Signed-off-by: Ewan Mellor <ewan@xensource.com>
author | Ewan Mellor <ewan@xensource.com> |
---|---|
date | Wed Nov 01 18:32:45 2006 +0000 (2006-11-01) |
parents | 4e17bf788e69 |
children | cf3d69ba5633 |
files | tools/libxc/xc_linux_save.c |
line diff
1.1 --- a/tools/libxc/xc_linux_save.c Wed Nov 01 18:20:23 2006 +0000 1.2 +++ b/tools/libxc/xc_linux_save.c Wed Nov 01 18:32:45 2006 +0000 1.3 @@ -978,12 +978,14 @@ int xc_linux_save(int xc_handle, int io_ 1.4 } 1.5 1.6 if(!write_exact(io_fd, &batch, sizeof(unsigned int))) { 1.7 - ERROR("Error when writing to state file (2)"); 1.8 + ERROR("Error when writing to state file (2) (errno %d)", 1.9 + errno); 1.10 goto out; 1.11 } 1.12 1.13 if(!write_exact(io_fd, pfn_type, sizeof(unsigned long)*j)) { 1.14 - ERROR("Error when writing to state file (3)"); 1.15 + ERROR("Error when writing to state file (3) (errno %d)", 1.16 + errno); 1.17 goto out; 1.18 } 1.19 1.20 @@ -1013,7 +1015,8 @@ int xc_linux_save(int xc_handle, int io_ 1.21 goto out; 1.22 1.23 if (ratewrite(io_fd, page, PAGE_SIZE) != PAGE_SIZE) { 1.24 - ERROR("Error when writing to state file (4)"); 1.25 + ERROR("Error when writing to state file (4)" 1.26 + " (errno %d)", errno); 1.27 goto out; 1.28 } 1.29 1.30 @@ -1021,7 +1024,8 @@ int xc_linux_save(int xc_handle, int io_ 1.31 1.32 /* We have a normal page: just write it directly. */ 1.33 if (ratewrite(io_fd, spage, PAGE_SIZE) != PAGE_SIZE) { 1.34 - ERROR("Error when writing to state file (5)"); 1.35 + ERROR("Error when writing to state file (5)" 1.36 + " (errno %d)", errno); 1.37 goto out; 1.38 } 1.39 } 1.40 @@ -1056,7 +1060,8 @@ int xc_linux_save(int xc_handle, int io_ 1.41 1.42 /* send "-1" to put receiver into debug mode */ 1.43 if(!write_exact(io_fd, &minusone, sizeof(int))) { 1.44 - ERROR("Error when writing to state file (6)"); 1.45 + ERROR("Error when writing to state file (6) (errno %d)", 1.46 + errno); 1.47 goto out; 1.48 } 1.49 1.50 @@ -1110,7 +1115,7 @@ int xc_linux_save(int xc_handle, int io_ 1.51 /* Zero terminate */ 1.52 i = 0; 1.53 if (!write_exact(io_fd, &i, sizeof(int))) { 1.54 - ERROR("Error when writing to state file (6)"); 1.55 + ERROR("Error when writing to state file (6') (errno %d)", errno); 1.56 goto out; 1.57 } 1.58 1.59 @@ -1125,7 +1130,7 @@ int xc_linux_save(int xc_handle, int io_ 1.60 } 1.61 1.62 if(!write_exact(io_fd, &j, sizeof(unsigned int))) { 1.63 - ERROR("Error when writing to state file (6a)"); 1.64 + ERROR("Error when writing to state file (6a) (errno %d)", errno); 1.65 goto out; 1.66 } 1.67 1.68 @@ -1137,7 +1142,8 @@ int xc_linux_save(int xc_handle, int io_ 1.69 i++; 1.70 if (j == 1024 || i == max_pfn) { 1.71 if(!write_exact(io_fd, &pfntab, sizeof(unsigned long)*j)) { 1.72 - ERROR("Error when writing to state file (6b)"); 1.73 + ERROR("Error when writing to state file (6b) (errno %d)", 1.74 + errno); 1.75 goto out; 1.76 } 1.77 j = 0; 1.78 @@ -1170,7 +1176,7 @@ int xc_linux_save(int xc_handle, int io_ 1.79 1.80 if (!write_exact(io_fd, &ctxt, sizeof(ctxt)) || 1.81 !write_exact(io_fd, live_shinfo, PAGE_SIZE)) { 1.82 - ERROR("Error when writing to state file (1)"); 1.83 + ERROR("Error when writing to state file (1) (errno %d)", errno); 1.84 goto out; 1.85 } 1.86