aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xc/lib/xc_linux_restore.c
diff options
context:
space:
mode:
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>2004-05-04 23:53:05 +0000
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>2004-05-04 23:53:05 +0000
commitf8442e9de0897f2f06984eb5fcbe11d12076f17f (patch)
treecb7c190b3d340961b342ef52ea47887f7b23b3b1 /tools/xc/lib/xc_linux_restore.c
parent59df7b5404c171a415575f1df9686aec8e8ac869 (diff)
downloadxen-f8442e9de0897f2f06984eb5fcbe11d12076f17f.tar.gz
xen-f8442e9de0897f2f06984eb5fcbe11d12076f17f.tar.bz2
xen-f8442e9de0897f2f06984eb5fcbe11d12076f17f.zip
bitkeeper revision 1.892 (40982ce1iEpN7cJYf3gJdBSj_2kRZw)
more live migrate prep
Diffstat (limited to 'tools/xc/lib/xc_linux_restore.c')
-rw-r--r--tools/xc/lib/xc_linux_restore.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/tools/xc/lib/xc_linux_restore.c b/tools/xc/lib/xc_linux_restore.c
index 65ba875aef..861d38a5f7 100644
--- a/tools/xc/lib/xc_linux_restore.c
+++ b/tools/xc/lib/xc_linux_restore.c
@@ -116,8 +116,6 @@ int xc_linux_restore(int xc_handle,
if ( (*readerfn)(readerst, name, sizeof(name)) ||
(*readerfn)(readerst, &nr_pfns, sizeof(unsigned long)) ||
- (*readerfn)(readerst, &ctxt, sizeof(ctxt)) ||
- (*readerfn)(readerst, shared_info, PAGE_SIZE) ||
(*readerfn)(readerst, pfn_to_mfn_frame_list, PAGE_SIZE) )
{
ERROR("Error when reading from state file");
@@ -181,10 +179,7 @@ int xc_linux_restore(int xc_handle,
if ( (pm_handle = init_pfn_mapper((domid_t)dom)) < 0 )
goto out;
- /* Copy saved contents of shared-info page. No checking needed. */
- ppage = map_pfn_writeable(pm_handle, shared_info_frame);
- memcpy(ppage, shared_info, PAGE_SIZE);
- unmap_pfn(pm_handle, ppage);
+
/* Build the pfn-to-mfn table. We choose MFN ordering returned by Xen. */
if ( get_pfn_list(xc_handle, dom, pfn_to_mfn_table, nr_pfns) != nr_pfns )
@@ -403,6 +398,15 @@ int xc_linux_restore(int xc_handle,
verbose_printf("\b\b\b\b100%%\nMemory reloaded.\n");
+
+ if ( (*readerfn)(readerst, &ctxt, sizeof(ctxt)) ||
+ (*readerfn)(readerst, shared_info, PAGE_SIZE) )
+ {
+ ERROR("Error when reading from state file");
+ goto out;
+ }
+
+
/* Uncanonicalise the suspend-record frame number and poke resume rec. */
pfn = ctxt.cpu_ctxt.esi;
if ( (pfn >= nr_pfns) || (pfn_type[pfn] != NONE) )
@@ -445,9 +449,13 @@ int xc_linux_restore(int xc_handle,
}
ctxt.pt_base = pfn_to_mfn_table[pfn] << PAGE_SHIFT;
- /* Uncanonicalise the pfn-to-mfn table frame-number list. */
+ /* Copy saved contents of shared-info page. No checking needed. */
+ ppage = map_pfn_writeable(pm_handle, shared_info_frame);
+ memcpy(ppage, shared_info, PAGE_SIZE);
+ unmap_pfn(pm_handle, ppage);
+ /* Uncanonicalise the pfn-to-mfn table frame-number list. */
if ( (mapper_handle1 = mfn_mapper_init(xc_handle, dom,
1024*1024, PROT_WRITE ))
== NULL )