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:13:06 +0000
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>2004-04-27 13:13:06 +0000
commitf57f5ec70d3e1b9d8047b14e0d5deafc2c549e5c (patch)
tree693486bc8f28d6e0df13f8763c7942c9c9fcaf7a /tools/xc/lib/xc_linux_restore.c
parent112600e25645a55218690c4c549e673546f7cb08 (diff)
parent6fecb4c1223cef5fc3203794e6fb1e9865d93ce5 (diff)
downloadxen-f57f5ec70d3e1b9d8047b14e0d5deafc2c549e5c.tar.gz
xen-f57f5ec70d3e1b9d8047b14e0d5deafc2c549e5c.tar.bz2
xen-f57f5ec70d3e1b9d8047b14e0d5deafc2c549e5c.zip
bitkeeper revision 1.879 (408e5c62UO4MIO4Nqnx5MucD8D5izg)
Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk into labyrinth.cl.cam.ac.uk:/auto/groups/xeno/users/iap10/xeno-clone/xeno.bk
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;