diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-04-04 16:18:28 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-04-04 16:18:28 +0100 |
commit | 087d43326ab4de5dbf25e67bd17dcc72262d2a65 (patch) | |
tree | f756b19e2ccfc63c67e8dafb391b9fa438cac786 /tools/xcutils | |
parent | 76de76e0f307eed8830d6a0507afb07a07dbc38e (diff) | |
download | xen-087d43326ab4de5dbf25e67bd17dcc72262d2a65.tar.gz xen-087d43326ab4de5dbf25e67bd17dcc72262d2a65.tar.bz2 xen-087d43326ab4de5dbf25e67bd17dcc72262d2a65.zip |
hvm: Lazy memory allocation during HVM restore. General cleanup and
reduce gross assumptions about memory-map layout.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/xcutils')
-rw-r--r-- | tools/xcutils/xc_restore.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tools/xcutils/xc_restore.c b/tools/xcutils/xc_restore.c index 4eef2ba8c7..3309efffa1 100644 --- a/tools/xcutils/xc_restore.c +++ b/tools/xcutils/xc_restore.c @@ -21,37 +21,37 @@ main(int argc, char **argv) unsigned int xc_fd, io_fd, domid, store_evtchn, console_evtchn; unsigned int hvm, pae, apic; int ret; - unsigned long p2m_size, max_nr_pfns, store_mfn, console_mfn; + unsigned long p2m_size, store_mfn, console_mfn; - if (argc != 10) - errx(1, "usage: %s iofd domid p2m_size max_nr_pfns store_evtchn " + if ( argc != 9 ) + errx(1, "usage: %s iofd domid p2m_size store_evtchn " "console_evtchn hvm pae apic", argv[0]); xc_fd = xc_interface_open(); - if (xc_fd < 0) + if ( xc_fd < 0 ) errx(1, "failed to open control interface"); io_fd = atoi(argv[1]); domid = atoi(argv[2]); p2m_size = atoi(argv[3]); - max_nr_pfns = atoi(argv[4]); - store_evtchn = atoi(argv[5]); - console_evtchn = atoi(argv[6]); - hvm = atoi(argv[7]); - pae = atoi(argv[8]); - apic = atoi(argv[9]); - - if (hvm) { - ret = xc_hvm_restore(xc_fd, io_fd, domid, max_nr_pfns, store_evtchn, - &store_mfn, pae, apic); - } else + store_evtchn = atoi(argv[4]); + console_evtchn = atoi(argv[5]); + hvm = atoi(argv[6]); + pae = atoi(argv[7]); + apic = atoi(argv[8]); + + if ( hvm ) + ret = xc_hvm_restore(xc_fd, io_fd, domid, store_evtchn, + &store_mfn, pae, apic); + else ret = xc_linux_restore(xc_fd, io_fd, domid, p2m_size, - max_nr_pfns, store_evtchn, &store_mfn, + store_evtchn, &store_mfn, console_evtchn, &console_mfn); - if (ret == 0) { + if ( ret == 0 ) + { printf("store-mfn %li\n", store_mfn); - if (!hvm) + if ( !hvm ) printf("console-mfn %li\n", console_mfn); fflush(stdout); } |