diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/xc/lib/xc_domain.c | 18 | ||||
-rw-r--r-- | tools/xc/lib/xc_linux_save.c | 19 |
2 files changed, 28 insertions, 9 deletions
diff --git a/tools/xc/lib/xc_domain.c b/tools/xc/lib/xc_domain.c index 20a323a047..38b3e2ee34 100644 --- a/tools/xc/lib/xc_domain.c +++ b/tools/xc/lib/xc_domain.c @@ -117,6 +117,24 @@ int xc_domain_getinfo(int xc_handle, return nr_doms; } +int xc_domain_getfullinfo(int xc_handle, + u32 domid, + dom0_op_t *op, + full_execution_context_t *ctxt ) +{ + int rc; + op->cmd = DOM0_GETDOMAININFO; + op->u.getdomaininfo.domain = (domid_t)domid; + op->u.getdomaininfo.ctxt = ctxt; + + rc = do_dom0_op(xc_handle, op); + if ( ((u32)op->u.getdomaininfo.domain != domid) && rc > 0 ) + return -ESRCH; + else + return rc; +} + + int xc_shadow_control(int xc_handle, u32 domid, unsigned int sop, diff --git a/tools/xc/lib/xc_linux_save.c b/tools/xc/lib/xc_linux_save.c index 02f67dfc27..e93120a08b 100644 --- a/tools/xc/lib/xc_linux_save.c +++ b/tools/xc/lib/xc_linux_save.c @@ -319,12 +319,17 @@ int xc_linux_save(int xc_handle, /* Ensure that the domain exists, and that it is stopped. */ - if ( xc_domain_pause( xc_handle, domid, &op, &ctxt ) ) + if ( xc_domain_pause( xc_handle, domid ) ) { PERROR("Could not pause domain"); goto out; } + if ( xc_domain_getfullinfo( xc_handle, domid, &op, &ctxt) ) + { + PERROR("Could not get full domain info"); + goto out; + } memcpy(name, op.u.getdomaininfo.name, sizeof(name)); shared_info_frame = op.u.getdomaininfo.shared_info_frame; @@ -381,7 +386,7 @@ int xc_linux_save(int xc_handle, pgd[HYPERVISOR_VIRT_START>>L2_PAGETABLE_SHIFT]>>PAGE_SHIFT; live_mfn_to_pfn_table = - mfn_mapper_map_single(xc_handle, ~0ULL, + mfn_mapper_map_single(xc_handle, ~0UL, PAGE_SIZE*1024, PROT_READ, mfn_to_pfn_table_start_mfn ); } @@ -805,7 +810,7 @@ int xc_linux_save(int xc_handle, DPRINTF("Start last iteration\n"); last_iter = 1; - xc_domain_pause( xc_handle, domid, &op, NULL ); + xc_domain_pause( xc_handle, domid ); } @@ -839,13 +844,9 @@ int xc_linux_save(int xc_handle, } /* Get the final execution context */ - op.cmd = DOM0_GETDOMAININFO; - op.u.getdomaininfo.domain = (domid_t)domid; - op.u.getdomaininfo.ctxt = &ctxt; - if ( (do_dom0_op(xc_handle, &op) < 0) || - ((u32)op.u.getdomaininfo.domain != domid) ) + if ( xc_domain_getfullinfo( xc_handle, domid, &op, &ctxt) ) { - PERROR("Could not get info on domain"); + PERROR("Could not get full domain info"); goto out; } |