xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [PATCH] libxc: xc_domain_save.c: rename "write_exact" macro
Date: Thu, 27 May 2010 16:55:11 +0100	[thread overview]
Message-ID: <1274975721-3777-5-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1274975721-3777-4-git-send-email-ian.jackson@eu.citrix.com>

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@eu.citrix.com>
---
 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

  reply	other threads:[~2010-05-27 15:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27 15:55 [PATCH 00/14] Logging cleanups, libxc API change Ian Jackson
2010-05-27 15:55 ` [PATCH] xl: Combine headers into one header file Ian Jackson
2010-05-27 15:55   ` [PATCH] xl: Move "extern" declarations to xl.h Ian Jackson
2010-05-27 15:55     ` [PATCH] stubdom/newlib: Provide correct names for time.h timezone variables Ian Jackson
2010-05-27 15:55       ` Ian Jackson [this message]
2010-05-27 15:55         ` [PATCH] libelf: Tidy up logging and remove dependency on stdio Ian Jackson
2010-05-27 15:55           ` [PATCH] xtl: New xentoollog mini-library Ian Jackson
2010-05-27 15:55             ` [PATCH] libxc: eliminate static variables, use xentoollog; API change Ian Jackson
2010-05-27 15:55               ` [PATCH] libxc: Use new DBGPRINTF for a few debugging output messages Ian Jackson
2010-05-27 15:55                 ` [PATCH] libxl: Fix up some incorrect printf formats Ian Jackson
2010-05-27 15:55                   ` [PATCH] libxl: Use the caller's logger (xentoollog) Ian Jackson
2010-05-27 15:55                     ` [PATCH] xl: Allow control of logging level Ian Jackson
2010-05-27 15:55                       ` [PATCH] libxc: save/restore error handling fixes Ian Jackson
2010-05-27 15:55                         ` [PATCH] libxc: remove \n from strings passed to PERROR Ian Jackson
2010-05-27 15:55                           ` [PATCH] xl/libxtl: Remove glitch in xl migrate log output Ian Jackson
2010-05-27 15:58 ` [PATCH 00/14] Logging cleanups, libxc API change Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1274975721-3777-5-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).