if ( ram_base == NULL )
{
- ERROR("map batch failed\n");
+ PERROR("map batch failed\n");
rc = 1;
goto out;
}
if ( xc_domain_memory_decrease_reservation(xch, dom, 1,
SUPERPAGE_PFN_SHIFT, &start_pfn) != 0 )
{
- ERROR("free 2M page failure @ 0x%ld.\n", next_pfn);
+ PERROR("free 2M page failure @ 0x%ld.\n", next_pfn);
rc = 1;
goto out;
}
if (xc_domain_memory_populate_physmap(xch, dom, 1, 0,
0, &mfn) != 0)
{
- ERROR("Failed to allocate physical memory.!\n");
+ PERROR("Failed to allocate physical memory.!\n");
errno = ENOMEM;
rc = 1;
goto out;
page_array, tot_pfns);
if ( ram_base == NULL )
{
- ERROR("map batch failed\n");
+ PERROR("map batch failed\n");
rc = 1;
goto out;
}
if (xc_domain_memory_populate_physmap(xch, dom, 1, 0,
0, &mfn) != 0)
{
- ERROR("Failed to allocate physical memory.! pfn=0x%lx, mfn=0x%lx.\n",
+ PERROR("Failed to allocate physical memory.! pfn=0x%lx, mfn=0x%lx.\n",
pfn, mfn);
errno = ENOMEM;
return 1;
#define HEARTBEAT_MS 1000
#ifndef __MINIOS__
-static ssize_t read_exact_timed(int fd, void* buf, size_t size)
+static ssize_t rdexact(struct xc_interface *xch, int fd, void* buf, size_t size)
{
size_t offset = 0;
ssize_t len;
FD_ZERO(&rfds);
FD_SET(fd, &rfds);
len = select(fd + 1, &rfds, NULL, NULL, &tv);
+ if ( len == -1 && errno == EINTR )
+ continue;
if ( !FD_ISSET(fd, &rfds) ) {
- fprintf(stderr, "read_exact_timed failed (select returned %zd)\n", len);
+ ERROR("read_exact_timed failed (select returned %zd)", len);
+ errno = ETIMEDOUT;
return -1;
}
}
len = read(fd, buf + offset, size - offset);
if ( (len == -1) && ((errno == EINTR) || (errno == EAGAIN)) )
continue;
+ if ( len == 0 )
+ errno = 0;
if ( len <= 0 )
return -1;
offset += len;
return 0;
}
-#define read_exact read_exact_timed
-
+#define RDEXACT(fd,buf,size) rdexact(xch, fd, buf, size)
#else
-#define read_exact_timed read_exact
+#define RDEXACT read_exact
#endif
/*
** In the state file (or during transfer), all page-table pages are
struct domain_info_context *dinfo = &ctx->dinfo;
/* Read first entry of P2M list, or extended-info signature (~0UL). */
- if ( read_exact(io_fd, &p2m_fl_zero, sizeof(long)) )
+ if ( RDEXACT(io_fd, &p2m_fl_zero, sizeof(long)) )
{
- ERROR("read extended-info signature failed");
+ PERROR("read extended-info signature failed");
return NULL;
}
uint32_t tot_bytes;
/* Next 4 bytes: total size of following extended info. */
- if ( read_exact(io_fd, &tot_bytes, sizeof(tot_bytes)) )
+ if ( RDEXACT(io_fd, &tot_bytes, sizeof(tot_bytes)) )
{
- ERROR("read extended-info size failed");
+ PERROR("read extended-info size failed");
return NULL;
}
char chunk_sig[4];
/* 4-character chunk signature + 4-byte remaining chunk size. */
- if ( read_exact(io_fd, chunk_sig, sizeof(chunk_sig)) ||
- read_exact(io_fd, &chunk_bytes, sizeof(chunk_bytes)) ||
+ if ( RDEXACT(io_fd, chunk_sig, sizeof(chunk_sig)) ||
+ RDEXACT(io_fd, &chunk_bytes, sizeof(chunk_bytes)) ||
(tot_bytes < (chunk_bytes + 8)) )
{
- ERROR("read extended-info chunk signature failed");
+ PERROR("read extended-info chunk signature failed");
return NULL;
}
tot_bytes -= 8;
return NULL;
}
- if ( read_exact(io_fd, &ctxt, chunk_bytes) )
+ if ( RDEXACT(io_fd, &ctxt, chunk_bytes) )
{
- ERROR("read extended-info vcpu context failed");
+ PERROR("read extended-info vcpu context failed");
return NULL;
}
tot_bytes -= chunk_bytes;
while ( chunk_bytes )
{
unsigned long sz = MIN(chunk_bytes, sizeof(xen_pfn_t));
- if ( read_exact(io_fd, &p2m_fl_zero, sz) )
+ if ( RDEXACT(io_fd, &p2m_fl_zero, sz) )
{
- ERROR("read-and-discard extended-info chunk bytes failed");
+ PERROR("read-and-discard extended-info chunk bytes failed");
return NULL;
}
chunk_bytes -= sz;
}
/* Now read the real first entry of P2M list. */
- if ( read_exact(io_fd, &p2m_fl_zero, sizeof(xen_pfn_t)) )
+ if ( RDEXACT(io_fd, &p2m_fl_zero, sizeof(xen_pfn_t)) )
{
- ERROR("read first entry of p2m_frame_list failed");
+ PERROR("read first entry of p2m_frame_list failed");
return NULL;
}
}
/* First entry has already been read. */
p2m_frame_list[0] = p2m_fl_zero;
- if ( read_exact(io_fd, &p2m_frame_list[1],
- (P2M_FL_ENTRIES - 1) * sizeof(xen_pfn_t)) )
+ if ( RDEXACT(io_fd, &p2m_frame_list[1],
+ (P2M_FL_ENTRIES - 1) * sizeof(xen_pfn_t)) )
{
- ERROR("read p2m_frame_list failed");
+ PERROR("read p2m_frame_list failed");
return NULL;
}
uint32_t qlen;
uint8_t *tmp;
- if ( read_exact(fd, &qlen, sizeof(qlen)) ) {
- ERROR("Error reading QEMU header length");
+ if ( RDEXACT(fd, &qlen, sizeof(qlen)) ) {
+ PERROR("Error reading QEMU header length");
return -1;
}
}
buf->qemubufsize = qlen;
- if ( read_exact(fd, buf->qemubuf, buf->qemubufsize) ) {
- ERROR("Error reading QEMU state");
+ if ( RDEXACT(fd, buf->qemubuf, buf->qemubufsize) ) {
+ PERROR("Error reading QEMU state");
return -1;
}
uint8_t *tmp;
unsigned char qemusig[21];
- if ( read_exact(fd, buf->magicpfns, sizeof(buf->magicpfns)) ) {
- ERROR("Error reading magic PFNs");
+ if ( RDEXACT(fd, buf->magicpfns, sizeof(buf->magicpfns)) ) {
+ PERROR("Error reading magic PFNs");
return -1;
}
- if ( read_exact(fd, &buf->reclen, sizeof(buf->reclen)) ) {
- ERROR("Error reading HVM params size");
+ if ( RDEXACT(fd, &buf->reclen, sizeof(buf->reclen)) ) {
+ PERROR("Error reading HVM params size");
return -1;
}
}
}
- if ( read_exact(fd, buf->hvmbuf, buf->reclen) ) {
- ERROR("Error reading HVM params");
+ if ( RDEXACT(fd, buf->hvmbuf, buf->reclen) ) {
+ PERROR("Error reading HVM params");
return -1;
}
- if ( read_exact(fd, qemusig, sizeof(qemusig)) ) {
- ERROR("Error reading QEMU signature");
+ if ( RDEXACT(fd, qemusig, sizeof(qemusig)) ) {
+ PERROR("Error reading QEMU signature");
return -1;
}
/* TODO: handle changing pfntab and vcpu counts */
/* PFN tab */
- if ( read_exact(fd, &buf->pfncount, sizeof(buf->pfncount)) ||
+ if ( RDEXACT(fd, &buf->pfncount, sizeof(buf->pfncount)) ||
(buf->pfncount > (1U << 28)) ) /* up to 1TB of address space */
{
- ERROR("Error when reading pfn count");
+ PERROR("Error when reading pfn count");
return -1;
}
pfnlen = sizeof(unsigned long) * buf->pfncount;
}
}
// DPRINTF("Reading PFN tab: %d bytes\n", pfnlen);
- if ( read_exact(fd, buf->pfntab, pfnlen) ) {
- ERROR("Error when reading pfntab");
+ if ( RDEXACT(fd, buf->pfntab, pfnlen) ) {
+ PERROR("Error when reading pfntab");
goto free_pfntab;
}
}
}
// DPRINTF("Reading VCPUS: %d bytes\n", vcpulen);
- if ( read_exact(fd, buf->vcpubuf, vcpulen) ) {
- ERROR("Error when reading ctxt");
+ if ( RDEXACT(fd, buf->vcpubuf, vcpulen) ) {
+ PERROR("Error when reading ctxt");
goto free_vcpus;
}
/* load shared_info_page */
// DPRINTF("Reading shared info: %lu bytes\n", PAGE_SIZE);
- if ( read_exact(fd, buf->shared_info_page, PAGE_SIZE) ) {
- ERROR("Error when reading shared info page");
+ if ( RDEXACT(fd, buf->shared_info_page, PAGE_SIZE) ) {
+ PERROR("Error when reading shared info page");
goto free_vcpus;
}
int count, countpages, oldcount, i;
void* ptmp;
- if ( read_exact(fd, &count, sizeof(count)) )
+ if ( RDEXACT(fd, &count, sizeof(count)) )
{
- ERROR("Error when reading batch size");
+ PERROR("Error when reading batch size");
return -1;
}
return pagebuf_get_one(xch, buf, fd, dom);
} else if (count == -2) {
buf->new_ctxt_format = 1;
- if ( read_exact(fd, &buf->max_vcpu_id, sizeof(buf->max_vcpu_id)) ||
- buf->max_vcpu_id >= 64 || read_exact(fd, &buf->vcpumap,
- sizeof(uint64_t)) ) {
- ERROR("Error when reading max_vcpu_id");
+ if ( RDEXACT(fd, &buf->max_vcpu_id, sizeof(buf->max_vcpu_id)) ||
+ buf->max_vcpu_id >= 64 || RDEXACT(fd, &buf->vcpumap,
+ sizeof(uint64_t)) ) {
+ PERROR("Error when reading max_vcpu_id");
return -1;
}
// DPRINTF("Max VCPU ID: %d, vcpumap: %llx\n", buf->max_vcpu_id, buf->vcpumap);
if ( read_exact(fd, &buf->identpt, sizeof(uint32_t)) ||
read_exact(fd, &buf->identpt, sizeof(uint64_t)) )
{
- ERROR("error read the address of the EPT identity map");
+ PERROR("error read the address of the EPT identity map");
return -1;
}
// DPRINTF("EPT identity map address: %llx\n", buf->identpt);
if ( read_exact(fd, &buf->vm86_tss, sizeof(uint32_t)) ||
read_exact(fd, &buf->vm86_tss, sizeof(uint64_t)) )
{
- ERROR("error read the address of the vm86 TSS");
+ PERROR("error read the address of the vm86 TSS");
return -1;
}
// DPRINTF("VM86 TSS location: %llx\n", buf->vm86_tss);
} else if ( count == -5 ) {
DPRINTF("xc_domain_restore start tmem\n");
if ( xc_tmem_restore(xch, dom, fd) ) {
- ERROR("error reading/restoring tmem");
+ PERROR("error reading/restoring tmem");
return -1;
}
return pagebuf_get_one(xch, buf, fd, dom);
}
else if ( count == -6 ) {
if ( xc_tmem_restore_extra(xch, dom, fd) ) {
- ERROR("error reading/restoring tmem extra");
+ PERROR("error reading/restoring tmem extra");
return -1;
}
return pagebuf_get_one(xch, buf, fd, dom);
read_exact(fd, &khz, sizeof(uint32_t)) ||
read_exact(fd, &incarn, sizeof(uint32_t)) ||
xc_domain_set_tsc_info(xch, dom, tsc_mode, nsec, khz, incarn) ) {
- ERROR("error reading/restoring tsc info");
+ PERROR("error reading/restoring tsc info");
return -1;
}
return pagebuf_get_one(xch, buf, fd, dom);
} else if ( (count > MAX_BATCH_SIZE) || (count < 0) ) {
ERROR("Max batch size exceeded (%d). Giving up.", count);
+ errno = EMSGSIZE;
return -1;
}
buf->pfn_types = ptmp;
}
if ( read_exact(fd, buf->pfn_types + oldcount, count * sizeof(*(buf->pfn_types)))) {
- ERROR("Error when reading region pfn types");
+ PERROR("Error when reading region pfn types");
return -1;
}
buf->pages = ptmp;
}
if ( read_exact(fd, buf->pages + oldcount * PAGE_SIZE, countpages * PAGE_SIZE) ) {
- ERROR("Error when reading pages");
+ PERROR("Error when reading pages");
return -1;
}
if ( region_base == NULL )
{
- ERROR("map batch failed");
+ PERROR("map batch failed");
free(pfn_err);
return -1;
}
(((unsigned long long)mfn) << PAGE_SHIFT)
| MMU_MACHPHYS_UPDATE, pfn) )
{
- ERROR("failed machpys update mfn=%lx pfn=%lx", mfn, pfn);
+ PERROR("failed machpys update mfn=%lx pfn=%lx", mfn, pfn);
goto err_mapped;
}
} /* end of 'batch' for loop */
if ( read_exact(io_fd, &dinfo->p2m_size, sizeof(unsigned long)) )
{
- ERROR("read: p2m_size");
+ PERROR("read: p2m_size");
goto out;
}
DPRINTF("xc_domain_restore start: p2m_size = %lx\n", dinfo->p2m_size);
frc = do_domctl(xch, &domctl);
if ( frc != 0 )
{
- ERROR("Unable to set guest address size.");
+ PERROR("Unable to set guest address size.");
goto out;
}
}
if ( lock_pages(region_mfn, sizeof(xen_pfn_t) * MAX_BATCH_SIZE) )
{
- ERROR("Could not lock region_mfn");
+ PERROR("Could not lock region_mfn");
goto out;
}
domctl.domain = (domid_t)dom;
if ( xc_domctl(xch, &domctl) < 0 )
{
- ERROR("Could not get information on new domain");
+ PERROR("Could not get information on new domain");
goto out;
}
shared_info_frame = domctl.u.getdomaininfo.shared_info_frame;
mmu = xc_alloc_mmu_updates(xch, dom);
if ( mmu == NULL )
{
- ERROR("Could not initialise for MMU updates");
+ PERROR("Could not initialise for MMU updates");
goto out;
}
if ( !completed ) {
pagebuf.nr_physpages = pagebuf.nr_pages = 0;
if ( pagebuf_get_one(xch, &pagebuf, io_fd, dom) < 0 ) {
- ERROR("Error when reading batch\n");
+ PERROR("Error when reading batch\n");
goto out;
}
}
*/
if ( !hvm && xc_flush_mmu_updates(xch, mmu) )
{
- ERROR("Error doing flush_mmu_updates()");
+ PERROR("Error doing flush_mmu_updates()");
goto out;
}
// DPRINTF("Buffered checkpoint\n");
if ( pagebuf_get(xch, &pagebuf, io_fd, dom) ) {
- ERROR("error when buffering batch, finishing\n");
+ PERROR("error when buffering batch, finishing");
goto finish;
}
memset(&tmptail, 0, sizeof(tmptail));
new_mfn = xc_make_page_below_4G(xch, dom, ctx->p2m[i]);
if ( !new_mfn )
{
- ERROR("Couldn't get a page below 4GB :-(");
+ PERROR("Couldn't get a page below 4GB :-(");
goto out;
}
<< PAGE_SHIFT) |
MMU_MACHPHYS_UPDATE, i) )
{
- ERROR("Couldn't m2p on PAE root pgdir");
+ PERROR("Couldn't m2p on PAE root pgdir");
goto out;
}
xch, dom, PROT_READ | PROT_WRITE, region_mfn, j);
if ( region_base == NULL )
{
- ERROR("map batch failed");
+ PERROR("map batch failed");
goto out;
}
if ( xc_flush_mmu_updates(xch, mmu) )
{
- ERROR("Error doing xc_flush_mmu_updates()");
+ PERROR("Error doing xc_flush_mmu_updates()");
goto out;
}
}
{
if ( xc_mmuext_op(xch, pin, nr_pins, dom) < 0 )
{
- ERROR("Failed to pin batch of %d page tables", nr_pins);
+ PERROR("Failed to pin batch of %d page tables", nr_pins);
goto out;
}
nr_pins = 0;
/* Flush final partial batch. */
if ( (nr_pins != 0) && (xc_mmuext_op(xch, pin, nr_pins, dom) < 0) )
{
- ERROR("Failed to pin batch of %d page tables", nr_pins);
+ PERROR("Failed to pin batch of %d page tables", nr_pins);
goto out;
}
if ( (frc = xc_memory_op(xch, XENMEM_decrease_reservation,
&reservation)) != nr_frees )
{
- ERROR("Could not decrease reservation : %d", frc);
+ PERROR("Could not decrease reservation : %d", frc);
goto out;
}
else
if ( lock_pages(&ctxt, sizeof(ctxt)) )
{
- ERROR("Unable to lock ctxt");
+ PERROR("Unable to lock ctxt");
return 1;
}
frc = xc_domctl(xch, &domctl);
if ( frc != 0 )
{
- ERROR("Couldn't build vcpu%d", i);
+ PERROR("Couldn't build vcpu%d", i);
goto out;
}
frc = xc_domctl(xch, &domctl);
if ( frc != 0 )
{
- ERROR("Couldn't set extended vcpu%d info\n", i);
+ PERROR("Couldn't set extended vcpu%d info\n", i);
goto out;
}
}
if ( !(ctx->live_p2m = xc_map_foreign_pages(xch, dom, PROT_WRITE,
p2m_frame_list, P2M_FL_ENTRIES)) )
{
- ERROR("Couldn't map p2m table");
+ PERROR("Couldn't map p2m table");
goto out;
}
finish_hvm:
/* Dump the QEMU state to a state file for QEMU to load */
if ( dump_qemu(xch, dom, &tailbuf.u.hvm) ) {
- ERROR("Error dumping QEMU state to file");
+ PERROR("Error dumping QEMU state to file");
goto out;
}
xc_clear_domain_page(xch, dom, tailbuf.u.hvm.magicpfns[1]) ||
xc_clear_domain_page(xch, dom, tailbuf.u.hvm.magicpfns[2]) )
{
- ERROR("error zeroing magic pages");
+ PERROR("error zeroing magic pages");
goto out;
}
HVM_PARAM_STORE_EVTCHN,
store_evtchn)) )
{
- ERROR("error setting HVM params: %i", frc);
+ PERROR("error setting HVM params: %i", frc);
goto out;
}
*store_mfn = tailbuf.u.hvm.magicpfns[2];
tailbuf.u.hvm.reclen);
if ( frc )
{
- ERROR("error setting the HVM context");
+ PERROR("error setting the HVM context");
goto out;
}
if ( write_count >= (MAX_PAGECACHE_USAGE * PAGE_SIZE) )
{
/* Time to discard cache - dont care if this fails */
+ int saved_errno = errno;
discard_file_cache(xch, fd, 0 /* no flush */);
+ errno = saved_errno;
write_count = 0;
}
p = xc_map_foreign_range(xch, dom, PAGE_SIZE, PROT_READ, fll);
if ( p == NULL )
- ERROR("Couldn't map p2m_frame_list_list (errno %d)", errno);
+ PERROR("Couldn't map p2m_frame_list_list (errno %d)", errno);
return p;
}
if ( xc_memory_op(xch, XENMEM_machphys_mfn_list, &xmml) ||
(xmml.nr_extents != m2p_chunks) )
{
- ERROR("xc_get_m2p_mfns");
+ PERROR("xc_get_m2p_mfns");
goto err1;
}
entries, m2p_chunks);
if (m2p == NULL)
{
- ERROR("xc_mmap_foreign_ranges failed");
+ PERROR("xc_mmap_foreign_ranges failed");
goto err2;
}
P2M_FLL_ENTRIES);
if ( !live_p2m_frame_list )
{
- ERROR("Couldn't map p2m_frame_list");
+ PERROR("Couldn't map p2m_frame_list");
goto out;
}
P2M_FL_ENTRIES);
if ( !p2m )
{
- ERROR("Couldn't map p2m table");
+ PERROR("Couldn't map p2m table");
goto out;
}
ctx->live_p2m = p2m; /* So that translation macros will work */
if ( xc_vcpu_getcontext(xch, dom, 0, &ctxt) )
{
- ERROR("Could not get vcpu context");
+ PERROR("Could not get vcpu context");
goto out;
}
if ( xc_domain_getinfo(xch, dom, 1, &info) != 1 )
{
- ERROR("Could not get domain info");
+ PERROR("Could not get domain info");
return 1;
}
PROT_READ, shared_info_frame);
if ( !live_shinfo )
{
- ERROR("Couldn't map live_shinfo");
+ PERROR("Couldn't map live_shinfo");
goto out;
}
}
if ( frc < 0 )
{
- ERROR("Couldn't enable shadow mode (rc %d) (errno %d)", frc, errno );
+ PERROR("Couldn't enable shadow mode (rc %d) (errno %d)", frc, errno );
goto out;
}
}
if ( lock_pages(to_send, BITMAP_SIZE) )
{
- ERROR("Unable to lock to_send");
+ PERROR("Unable to lock to_send");
return 1;
}
/* (to fix is local only) */
if ( lock_pages(to_skip, BITMAP_SIZE) )
{
- ERROR("Unable to lock to_skip");
+ PERROR("Unable to lock to_skip");
return 1;
}
hvm_buf_size = xc_domain_hvm_getcontext(xch, dom, 0, 0);
if ( hvm_buf_size == -1 )
{
- ERROR("Couldn't get HVM context size from Xen");
+ PERROR("Couldn't get HVM context size from Xen");
goto out;
}
hvm_buf = malloc(hvm_buf_size);
if ( lock_pages(pfn_type, MAX_BATCH_SIZE * sizeof(*pfn_type)) )
{
- ERROR("Unable to lock pfn_type array");
+ PERROR("Unable to lock pfn_type array");
goto out;
}
/* Setup the mfn_to_pfn table mapping */
if ( !(ctx->live_m2p = xc_map_m2p(xch, ctx->max_mfn, PROT_READ, &ctx->m2p_mfn0)) )
{
- ERROR("Failed to map live M2P table");
+ PERROR("Failed to map live M2P table");
goto out;
}
ctx->live_p2m = map_and_save_p2m_table(xch, io_fd, dom, ctx, live_shinfo);
if ( ctx->live_p2m == NULL )
{
- ERROR("Failed to map/save the p2m frame list");
+ PERROR("Failed to map/save the p2m frame list");
goto out;
}
tmem_saved = xc_tmem_save(xch, dom, io_fd, live, -5);
if ( tmem_saved == -1 )
{
- ERROR("Error when writing to state file (tmem)");
+ PERROR("Error when writing to state file (tmem)");
goto out;
}
if ( !live && save_tsc_info(xch, dom, io_fd) < 0 )
{
- ERROR("Error when writing to state file (tsc)");
+ PERROR("Error when writing to state file (tsc)");
goto out;
}
xch, dom, PROT_READ, pfn_type, pfn_err, batch);
if ( region_base == NULL )
{
- ERROR("map batch failed");
+ PERROR("map batch failed");
goto out;
}
/* Get page types */
if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
{
- ERROR("get_pfn_type_batch failed");
+ PERROR("get_pfn_type_batch failed");
goto out;
}
(char*)region_base+(PAGE_SIZE*(j-run)),
PAGE_SIZE*run) != PAGE_SIZE*run )
{
- ERROR("Error when writing to state file (4a)"
+ PERROR("Error when writing to state file (4a)"
" (errno %d)", errno);
goto out;
}
if ( ratewrite(io_fd, live, page, PAGE_SIZE) != PAGE_SIZE )
{
- ERROR("Error when writing to state file (4b)"
+ PERROR("Error when writing to state file (4b)"
" (errno %d)", errno);
goto out;
}
(char*)region_base+(PAGE_SIZE*(j-run)),
PAGE_SIZE*run) != PAGE_SIZE*run )
{
- ERROR("Error when writing to state file (4c)"
+ PERROR("Error when writing to state file (4c)"
" (errno %d)", errno);
goto out;
}
if ( (tmem_saved > 0) &&
(xc_tmem_save_extra(xch,dom,io_fd,-6) == -1) )
{
- ERROR("Error when writing to state file (tmem)");
+ PERROR("Error when writing to state file (tmem)");
goto out;
}
if ( save_tsc_info(xch, dom, io_fd) < 0 )
{
- ERROR("Error when writing to state file (tsc)");
+ PERROR("Error when writing to state file (tsc)");
goto out;
}
XEN_DOMCTL_SHADOW_OP_CLEAN, to_send,
dinfo->p2m_size, NULL, 0, &stats) != dinfo->p2m_size )
{
- ERROR("Error flushing shadow PT");
+ PERROR("Error flushing shadow PT");
goto out;
}
if ( (rec_size = xc_domain_hvm_getcontext(xch, dom, hvm_buf,
hvm_buf_size)) == -1 )
{
- ERROR("HVM:Could not get hvm buffer");
+ PERROR("HVM:Could not get hvm buffer");
goto out;
}
if ( xc_vcpu_getcontext(xch, dom, 0, &ctxt) )
{
- ERROR("Could not get vcpu context");
+ PERROR("Could not get vcpu context");
goto out;
}
if ( (i != 0) && xc_vcpu_getcontext(xch, dom, i, &ctxt) )
{
- ERROR("No context for VCPU%d", i);
+ PERROR("No context for VCPU%d", i);
goto out;
}
domctl.u.ext_vcpucontext.vcpu = i;
if ( xc_domctl(xch, &domctl) < 0 )
{
- ERROR("No extended context for VCPU%d", i);
+ PERROR("No extended context for VCPU%d", i);
goto out;
}
if ( wrexact(io_fd, &domctl.u.ext_vcpucontext, 128) )
/* Flush last write and discard cache for file. */
if ( outbuf_flush(xch, &ob, io_fd) < 0 ) {
- ERROR("Error when flushing output buffer\n");
+ PERROR("Error when flushing output buffer\n");
rc = 1;
}
XEN_DOMCTL_SHADOW_OP_CLEAN, to_send,
dinfo->p2m_size, NULL, 0, &stats) != dinfo->p2m_size )
{
- ERROR("Error flushing shadow PT");
+ PERROR("Error flushing shadow PT");
}
goto copypages;