aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xcutils
diff options
context:
space:
mode:
authorTim Deegan <Tim.Deegan@xensource.com>2007-01-18 16:48:03 +0000
committerTim Deegan <Tim.Deegan@xensource.com>2007-01-18 16:48:03 +0000
commit4a13cf1b7005cc5022b67f2e96ab597108333704 (patch)
tree422fe75359dbf0f1b06c2028e3644f11c2c3826d /tools/xcutils
parentccace2b70456834cbaff446025d438c480f81bd4 (diff)
downloadxen-4a13cf1b7005cc5022b67f2e96ab597108333704.tar.gz
xen-4a13cf1b7005cc5022b67f2e96ab597108333704.tar.bz2
xen-4a13cf1b7005cc5022b67f2e96ab597108333704.zip
[HVM] save restore: frame work
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> frame work for HVM save restore in Control Panel
Diffstat (limited to 'tools/xcutils')
-rw-r--r--tools/xcutils/xc_restore.c19
-rw-r--r--tools/xcutils/xc_save.c5
2 files changed, 19 insertions, 5 deletions
diff --git a/tools/xcutils/xc_restore.c b/tools/xcutils/xc_restore.c
index c8b2b89331..8e26d9bb70 100644
--- a/tools/xcutils/xc_restore.c
+++ b/tools/xcutils/xc_restore.c
@@ -19,12 +19,13 @@ int
main(int argc, char **argv)
{
unsigned int xc_fd, io_fd, domid, nr_pfns, store_evtchn, console_evtchn;
+ unsigned int hvm, pae, apic;
int ret;
unsigned long store_mfn, console_mfn;
- if (argc != 6)
+ if (argc != 9)
errx(1,
- "usage: %s iofd domid nr_pfns store_evtchn console_evtchn",
+ "usage: %s iofd domid nr_pfns store_evtchn console_evtchn hvm pae apic",
argv[0]);
xc_fd = xc_interface_open();
@@ -36,9 +37,19 @@ main(int argc, char **argv)
nr_pfns = atoi(argv[3]);
store_evtchn = atoi(argv[4]);
console_evtchn = atoi(argv[5]);
+ hvm = atoi(argv[6]);
+ pae = atoi(argv[7]);
+ apic = atoi(argv[8]);
+
+ if (hvm) {
+ /* pass the memsize to xc_hvm_restore to find the store_mfn */
+ store_mfn = hvm;
+ ret = xc_hvm_restore(xc_fd, io_fd, domid, nr_pfns, store_evtchn,
+ &store_mfn, console_evtchn, &console_mfn, pae, apic);
+ } else
+ ret = xc_linux_restore(xc_fd, io_fd, domid, nr_pfns, store_evtchn,
+ &store_mfn, console_evtchn, &console_mfn);
- ret = xc_linux_restore(xc_fd, io_fd, domid, nr_pfns, store_evtchn,
- &store_mfn, console_evtchn, &console_mfn);
if (ret == 0) {
printf("store-mfn %li\n", store_mfn);
printf("console-mfn %li\n", console_mfn);
diff --git a/tools/xcutils/xc_save.c b/tools/xcutils/xc_save.c
index c9be3454d4..0c9530da4d 100644
--- a/tools/xcutils/xc_save.c
+++ b/tools/xcutils/xc_save.c
@@ -51,7 +51,10 @@ main(int argc, char **argv)
max_f = atoi(argv[4]);
flags = atoi(argv[5]);
- ret = xc_linux_save(xc_fd, io_fd, domid, maxit, max_f, flags, &suspend);
+ if (flags & XCFLAGS_HVM)
+ ret = xc_hvm_save(xc_fd, io_fd, domid, maxit, max_f, flags, &suspend);
+ else
+ ret = xc_linux_save(xc_fd, io_fd, domid, maxit, max_f, flags, &suspend);
xc_interface_close(xc_fd);