diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-12-01 13:53:14 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-12-01 13:53:14 +0000 |
commit | 60999322eb87ccd91f5208bdd684f1762d664c2e (patch) | |
tree | 6b08eb3020ecc7c0fc4828cfff3229154ffaa9b8 /tools/libxc/xc_offline_page.c | |
parent | d47a8e863a56c4e2db18198ebfe21100be086b77 (diff) | |
download | xen-60999322eb87ccd91f5208bdd684f1762d664c2e.tar.gz xen-60999322eb87ccd91f5208bdd684f1762d664c2e.tar.bz2 xen-60999322eb87ccd91f5208bdd684f1762d664c2e.zip |
libxc: create a domain_info_context structure to store guest_width and p2m_size for macros.
Macro now refers to guest_width and p2m_size through a dinfo pointer.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_offline_page.c')
-rw-r--r-- | tools/libxc/xc_offline_page.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c index c386d883e9..eb6d998aa0 100644 --- a/tools/libxc/xc_offline_page.c +++ b/tools/libxc/xc_offline_page.c @@ -45,8 +45,8 @@ struct pte_backup int cur; }; -/* Global definition for some MACRO */ -int guest_width, p2m_size; +static struct domain_info_context _dinfo; +static struct domain_info_context *dinfo = &_dinfo; int xc_mark_page_online(int xc, unsigned long start, unsigned long end, uint32_t *status) @@ -234,7 +234,7 @@ static int init_mem_info(int xc_handle, int domid, ERROR("Unable to get PT level info."); return -EFAULT; } - guest_width = minfo->guest_width; + dinfo->guest_width = minfo->guest_width; shared_info_frame = info->shared_info_frame; @@ -255,7 +255,7 @@ static int init_mem_info(int xc_handle, int domid, munmap(live_shinfo, PAGE_SIZE); live_shinfo = NULL; - p2m_size = minfo->p2m_size; + dinfo->p2m_size = minfo->p2m_size; minfo->max_mfn = xc_memory_op(xc_handle, XENMEM_maximum_ram_page, NULL); if ( !(minfo->m2p_table = @@ -286,7 +286,7 @@ static int init_mem_info(int xc_handle, int domid, for (i = 0; i < minfo->p2m_size ; i+=1024) { - int count = ((p2m_size - i ) > 1024 ) ? 1024: (p2m_size - i); + int count = ((dinfo->p2m_size - i ) > 1024 ) ? 1024: (dinfo->p2m_size - i); if ( ( rc = xc_get_pfn_type_batch(xc_handle, domid, count, minfo->pfn_type + i)) ) { |