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

[Xen-devel] [PATCH] libxc: xc_domain_save.c: rename "write_exact" macro



There is already a "write_exact" function declared in xc_private.h.
So rename this macro to to wrexact.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 tools/libxc/xc_domain_save.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index cb98374..876ca6d 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1134,7 +1134,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
     }
 
   copypages:
-#define write_exact(fd, buf, len) write_buffer(last_iter, &ob, (fd), (buf), 
(len))
+#define wrexact(fd, buf, len) write_buffer(last_iter, &ob, (fd), (buf), (len))
 #ifdef ratewrite
 #undef ratewrite
 #endif
@@ -1334,7 +1334,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
                 }
             }
 
-            if ( write_exact(io_fd, &batch, sizeof(unsigned int)) )
+            if ( wrexact(io_fd, &batch, sizeof(unsigned int)) )
             {
                 PERROR("Error when writing to state file (2)");
                 goto out;
@@ -1343,7 +1343,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
             if ( sizeof(unsigned long) < sizeof(*pfn_type) )
                 for ( j = 0; j < batch; j++ )
                     ((unsigned long *)pfn_type)[j] = pfn_type[j];
-            if ( write_exact(io_fd, pfn_type, sizeof(unsigned long)*batch) )
+            if ( wrexact(io_fd, pfn_type, sizeof(unsigned long)*batch) )
             {
                 PERROR("Error when writing to state file (3)");
                 goto out;
@@ -1457,7 +1457,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
             DPRINTF("Entering debug resend-all mode\n");
 
             /* send "-1" to put receiver into debug mode */
-            if ( write_exact(io_fd, &minusone, sizeof(int)) )
+            if ( wrexact(io_fd, &minusone, sizeof(int)) )
             {
                 PERROR("Error when writing to state file (6)");
                 goto out;
@@ -1542,7 +1542,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
         }
 
         chunk.vcpumap = vcpumap;
-        if ( write_exact(io_fd, &chunk, sizeof(chunk)) )
+        if ( wrexact(io_fd, &chunk, sizeof(chunk)) )
         {
             PERROR("Error when writing to state file");
             goto out;
@@ -1562,7 +1562,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
                          (unsigned long *)&chunk.data);
 
         if ( (chunk.data != 0) &&
-             write_exact(io_fd, &chunk, sizeof(chunk)) )
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
         {
             PERROR("Error when writing the ident_pt for EPT guest");
             goto out;
@@ -1573,7 +1573,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
                          (unsigned long *)&chunk.data);
 
         if ( (chunk.data != 0) &&
-             write_exact(io_fd, &chunk, sizeof(chunk)) )
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
         {
             PERROR("Error when writing the vm86 TSS for guest");
             goto out;
@@ -1582,7 +1582,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
 
     /* Zero terminate */
     i = 0;
-    if ( write_exact(io_fd, &i, sizeof(int)) )
+    if ( wrexact(io_fd, &i, sizeof(int)) )
     {
         PERROR("Error when writing to state file (6')");
         goto out;
@@ -1600,7 +1600,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
                          (unsigned long *)&magic_pfns[1]);
         xc_get_hvm_param(xc_handle, dom, HVM_PARAM_STORE_PFN,
                          (unsigned long *)&magic_pfns[2]);
-        if ( write_exact(io_fd, magic_pfns, sizeof(magic_pfns)) )
+        if ( wrexact(io_fd, magic_pfns, sizeof(magic_pfns)) )
         {
             PERROR("Error when writing to state file (7)");
             goto out;
@@ -1614,13 +1614,13 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
             goto out;
         }
         
-        if ( write_exact(io_fd, &rec_size, sizeof(uint32_t)) )
+        if ( wrexact(io_fd, &rec_size, sizeof(uint32_t)) )
         {
             PERROR("error write hvm buffer size");
             goto out;
         }
         
-        if ( write_exact(io_fd, hvm_buf, rec_size) )
+        if ( wrexact(io_fd, hvm_buf, rec_size) )
         {
             PERROR("write HVM info failed!\n");
             goto out;
@@ -1644,7 +1644,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
                 j++;
         }
 
-        if ( write_exact(io_fd, &j, sizeof(unsigned int)) )
+        if ( wrexact(io_fd, &j, sizeof(unsigned int)) )
         {
             PERROR("Error when writing to state file (6a)");
             goto out;
@@ -1658,7 +1658,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
             i++;
             if ( (j == 1024) || (i == dinfo->p2m_size) )
             {
-                if ( write_exact(io_fd, &pfntab, sizeof(unsigned long)*j) )
+                if ( wrexact(io_fd, &pfntab, sizeof(unsigned long)*j) )
                 {
                     PERROR("Error when writing to state file (6b)");
                     goto out;
@@ -1729,7 +1729,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
                 FOLD_CR3(mfn_to_pfn(UNFOLD_CR3(ctxt.x64.ctrlreg[1])));
         }
 
-        if ( write_exact(io_fd, &ctxt, ((dinfo->guest_width==8) 
+        if ( wrexact(io_fd, &ctxt, ((dinfo->guest_width==8) 
                                         ? sizeof(ctxt.x64) 
                                         : sizeof(ctxt.x32))) )
         {
@@ -1745,7 +1745,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
             ERROR("No extended context for VCPU%d", i);
             goto out;
         }
-        if ( write_exact(io_fd, &domctl.u.ext_vcpucontext, 128) )
+        if ( wrexact(io_fd, &domctl.u.ext_vcpucontext, 128) )
         {
             PERROR("Error when writing to state file (2)");
             goto out;
@@ -1758,7 +1758,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t 
dom, uint32_t max_iters,
     memcpy(page, live_shinfo, PAGE_SIZE);
     SET_FIELD(((shared_info_any_t *)page), 
               arch.pfn_to_mfn_frame_list_list, 0);
-    if ( write_exact(io_fd, page, PAGE_SIZE) )
+    if ( wrexact(io_fd, page, PAGE_SIZE) )
     {
         PERROR("Error when writing to state file (1)");
         goto out;
-- 
1.5.6.5


_______________________________________________
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®.