direct-io.hg

view tools/xcutils/xc_restore.c @ 7477:5a7baecb1c70

Fix an issue for passing arguement from control panel to deivce model
for some arguemnt like 'localtime', 'isa', device model need an argument
"-localtime", instead of "-localtime 1"
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Oct 23 16:51:47 2005 +0100 (2005-10-23)
parents 06d84bf87159
children bb37d167c82e
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 <xenguest.h>
17 int
18 main(int argc, char **argv)
19 {
20 unsigned int xc_fd, io_fd, domid, nr_pfns, store_evtchn, console_evtchn;
21 int ret;
22 unsigned long store_mfn, console_mfn;
24 if (argc != 7)
25 errx(1,
26 "usage: %s xcfd iofd domid nr_pfns store_evtchn console_evtchn",
27 argv[0]);
29 xc_fd = atoi(argv[1]);
30 io_fd = atoi(argv[2]);
31 domid = atoi(argv[3]);
32 nr_pfns = atoi(argv[4]);
33 store_evtchn = atoi(argv[5]);
34 console_evtchn = atoi(argv[6]);
36 ret = xc_linux_restore(xc_fd, io_fd, domid, nr_pfns, store_evtchn,
37 &store_mfn, console_evtchn, &console_mfn);
38 if (ret == 0) {
39 printf("store-mfn %li\n", store_mfn);
40 printf("console-mfn %li\n", console_mfn);
41 fflush(stdout);
42 }
43 return ret;
44 }