debuggers.hg

view tools/xcutils/xc_restore.c @ 21067:b4a1832a916f

Update Xen version to 4.0.0-rc6
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 09 18:18:05 2010 +0000 (2010-03-09)
parents 205b1badbcfd
children 3ffdb094c2c0
line source
1 /*
2 * This file is subject to the terms and conditions of the GNU General
3 * Public License. See the file "COPYING" in the main directory of
4 * this archive for more details.
5 *
6 * Copyright (C) 2005 by Christian Limpach
7 *
8 */
10 #include <err.h>
11 #include <stdlib.h>
12 #include <stdint.h>
13 #include <stdio.h>
15 #include <xenctrl.h>
16 #include <xenguest.h>
18 int
19 main(int argc, char **argv)
20 {
21 unsigned int domid, store_evtchn, console_evtchn;
22 unsigned int hvm, pae, apic;
23 int xc_fd, io_fd, ret;
24 int superpages;
25 unsigned long store_mfn, console_mfn;
27 if ( (argc != 8) && (argc != 9) )
28 errx(1, "usage: %s iofd domid store_evtchn "
29 "console_evtchn hvm pae apic [superpages]", argv[0]);
31 xc_fd = xc_interface_open();
32 if ( xc_fd < 0 )
33 errx(1, "failed to open control interface");
35 io_fd = atoi(argv[1]);
36 domid = atoi(argv[2]);
37 store_evtchn = atoi(argv[3]);
38 console_evtchn = atoi(argv[4]);
39 hvm = atoi(argv[5]);
40 pae = atoi(argv[6]);
41 apic = atoi(argv[7]);
42 if ( argc == 9 )
43 superpages = atoi(argv[8]);
44 else
45 superpages = 0;
47 ret = xc_domain_restore(xc_fd, io_fd, domid, store_evtchn, &store_mfn,
48 console_evtchn, &console_mfn, hvm, pae, superpages);
50 if ( ret == 0 )
51 {
52 printf("store-mfn %li\n", store_mfn);
53 if ( !hvm )
54 printf("console-mfn %li\n", console_mfn);
55 fflush(stdout);
56 }
58 xc_interface_close(xc_fd);
60 return ret;
61 }