}
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
}
}
- 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;
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;
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;
}
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;
(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;
(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;
/* 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;
(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;
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;
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;
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;
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))) )
{
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;
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;