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-04-27 13:12:58 +0000
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>2004-04-27 13:12:58 +0000
commit6fecb4c1223cef5fc3203794e6fb1e9865d93ce5 (patch)
tree473d2ffe8e53ee531e914ef341b60127454c6e41 /tools/xc/lib/xc_linux_restore.c
parent9e23ec36d64e35c8ffa24c1c52f028f17ed5949d (diff)
downloadxen-6fecb4c1223cef5fc3203794e6fb1e9865d93ce5.tar.gz
xen-6fecb4c1223cef5fc3203794e6fb1e9865d93ce5.tar.bz2
xen-6fecb4c1223cef5fc3203794e6fb1e9865d93ce5.zip
bitkeeper revision 1.875.1.1 (408e5c5aIA7qWjhncD0DlSXVXY2xtg)
Suspend/resume now fixed fix objdump 'debug' option in Makefile
Diffstat (limited to 'tools/xc/lib/xc_linux_restore.c')
-rw-r--r--tools/xc/lib/xc_linux_restore.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/tools/xc/lib/xc_linux_restore.c b/tools/xc/lib/xc_linux_restore.c
index 3decb28559..239df65984 100644
--- a/tools/xc/lib/xc_linux_restore.c
+++ b/tools/xc/lib/xc_linux_restore.c
@@ -52,6 +52,7 @@ static int checked_read(gzFile fd, void *buf, size_t count)
}
int xc_linux_restore(int xc_handle,
+ u64 dom,
const char *state_file,
int verbose,
u64 *pdomid)
@@ -59,7 +60,6 @@ int xc_linux_restore(int xc_handle,
dom0_op_t op;
int rc = 1, i, j;
unsigned long mfn, pfn;
- u64 dom = 0ULL;
unsigned int prev_pc, this_pc;
/* Number of page frames in use by this Linux session. */
@@ -165,16 +165,21 @@ int xc_linux_restore(int xc_handle,
goto out;
}
- /* Create a new domain of the appropriate size, and find it's dom_id. */
- op.cmd = DOM0_CREATEDOMAIN;
- op.u.createdomain.memory_kb = nr_pfns * (PAGE_SIZE / 1024);
- memcpy(op.u.createdomain.name, name, MAX_DOMAIN_NAME);
- if ( do_dom0_op(xc_handle, &op) < 0 )
+ /* Set the domain's name to that from the restore file */
+ if ( xc_domain_setname( xc_handle, dom, name ) )
+ {
+ ERROR("Could not set domain name");
+ goto out;
+ }
+
+ /* Set the domain's initial memory allocation
+ to that from the restore file */
+
+ if ( xc_domain_setinitialmem( xc_handle, dom, nr_pfns * (PAGE_SIZE / 1024)) )
{
- ERROR("Could not create new domain");
+ ERROR("Could not set domain initial memory");
goto out;
}
- dom = (u64)op.u.createdomain.domain;
/* Get the domain's shared-info frame. */
op.cmd = DOM0_GETDOMAININFO;