aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_linux_restore.c
diff options
context:
space:
mode:
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-05-23 10:24:56 +0000
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-05-23 10:24:56 +0000
commitfa16d770580a3be150f15049bcf868bb36465f83 (patch)
treec800039344400bacc34d115042f62bada081675b /tools/libxc/xc_linux_restore.c
parentf900ac3343f4bb09798ca70cf55c674fc586d946 (diff)
downloadxen-fa16d770580a3be150f15049bcf868bb36465f83.tar.gz
xen-fa16d770580a3be150f15049bcf868bb36465f83.tar.bz2
xen-fa16d770580a3be150f15049bcf868bb36465f83.zip
bitkeeper revision 1.1511 (4291af78wDb78xhg10ccUaCX1vnh_w)
XendDomain.py, xc.c, xc_linux_restore.c, xc.h: Move read of pfn to mfn frame list into xc_linux_restore. Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Diffstat (limited to 'tools/libxc/xc_linux_restore.c')
-rw-r--r--tools/libxc/xc_linux_restore.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/libxc/xc_linux_restore.c b/tools/libxc/xc_linux_restore.c
index fe92441511..7d6aec2859 100644
--- a/tools/libxc/xc_linux_restore.c
+++ b/tools/libxc/xc_linux_restore.c
@@ -32,8 +32,7 @@
#define PPRINTF(_f, _a...)
#endif
-int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
- unsigned char *pfn2mfn)
+int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns)
{
dom0_op_t op;
int rc = 1, i, n, k;
@@ -60,7 +59,7 @@ int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
unsigned long *ppage = NULL;
/* A copy of the pfn-to-mfn table frame list. */
- unsigned long *pfn_to_mfn_frame_list = (void *)pfn2mfn; // [1024];
+ unsigned long pfn_to_mfn_frame_list[1024];
/* A table mapping each PFN to its new MFN. */
unsigned long *pfn_to_mfn_table = NULL;
@@ -91,6 +90,11 @@ int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
return 1;
}
+ if (read(io_fd, pfn_to_mfn_frame_list, PAGE_SIZE) != PAGE_SIZE) {
+ ERR("read pfn_to_mfn_frame_list failed");
+ goto out;
+ }
+
/* We want zeroed memory so use calloc rather than malloc. */
pfn_to_mfn_table = calloc(4, nr_pfns);
pfn_type = calloc(4, nr_pfns);