aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-12-01 13:55:15 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-12-01 13:55:15 +0000
commit54439bd307518739936dd81e31c751fd3436652b (patch)
treed7251155e0b0280120dfad0ca6c3f5ec00436f45 /tools/libxc
parenta87d572ea467be655eb5940cd29de25ca1fe8889 (diff)
downloadxen-54439bd307518739936dd81e31c751fd3436652b.tar.gz
xen-54439bd307518739936dd81e31c751fd3436652b.tar.bz2
xen-54439bd307518739936dd81e31c751fd3436652b.zip
libxc: move domain_info_context into the save_context
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Diffstat (limited to 'tools/libxc')
-rw-r--r--tools/libxc/xc_domain_save.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 0423aba059..6ea86e4b44 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -30,23 +30,22 @@
#define DEF_MAX_ITERS 29 /* limit us to 30 times round loop */
#define DEF_MAX_FACTOR 3 /* never send more than 3x p2m_size */
-struct save_context {
+struct save_ctx {
unsigned long hvirt_start; /* virtual starting address of the hypervisor */
unsigned int pt_levels; /* #levels of page tables used by the current guest */
unsigned long max_mfn; /* max mfn of the whole machine */
xen_pfn_t *live_p2m; /* Live mapping of the table mapping each PFN to its current MFN. */
xen_pfn_t *live_m2p; /* Live mapping of system MFN to PFN table. */
unsigned long m2p_mfn0;
+ struct domain_info_context dinfo;
};
-static struct domain_info_context _dinfo;
-static struct domain_info_context *dinfo = &_dinfo;
-
-static struct save_context _ctx = {
+static struct save_ctx _ctx = {
.live_p2m = NULL,
.live_m2p = NULL,
};
-static struct save_context *ctx = &_ctx;
+
+static struct save_ctx *ctx = &_ctx;
/* buffer for output */
struct outbuf {
@@ -403,6 +402,7 @@ static int analysis_phase(int xc_handle, uint32_t domid,
long long start, now;
xc_shadow_op_stats_t stats;
int j;
+ struct domain_info_context *dinfo = &ctx->dinfo;
start = llgettimeofday();
@@ -458,6 +458,7 @@ static void *map_frame_list_list(int xc_handle, uint32_t dom,
{
int count = 100;
void *p;
+ struct domain_info_context *dinfo = &ctx->dinfo;
uint64_t fll = GET_FIELD(shinfo, arch.pfn_to_mfn_frame_list_list);
while ( count-- && (fll == 0) )
@@ -491,7 +492,7 @@ static void *map_frame_list_list(int xc_handle, uint32_t dom,
static int canonicalize_pagetable(unsigned long type, unsigned long pfn,
const void *spage, void *dpage)
{
-
+ struct domain_info_context *dinfo = &ctx->dinfo;
int i, pte_last, xen_start, xen_end, race = 0;
uint64_t pte;
@@ -672,6 +673,7 @@ static xen_pfn_t *map_and_save_p2m_table(int xc_handle,
shared_info_any_t *live_shinfo)
{
vcpu_guest_context_any_t ctxt;
+ struct domain_info_context *dinfo = &ctx->dinfo;
/* Double and single indirect references to the live P2M table */
void *live_p2m_frame_list_list = NULL;
@@ -910,6 +912,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
unsigned long mfn;
struct outbuf ob;
+ struct domain_info_context *dinfo = &ctx->dinfo;
int completed = 0;