ia64/xen-unstable

view tools/internal/xi_start.c @ 747:885d2d2dbb61

bitkeeper revision 1.447 (3f6b4a5bx66eWPkM9ZVWGugRdLunrg)

typos
author iap10@labyrinth.cl.cam.ac.uk
date Fri Sep 19 18:26:35 2003 +0000 (2003-09-19)
parents e09b8abaa2e3
children 8305b95a7772
line source
2 #include "hypervisor-ifs/dom0_ops.h"
3 #include "dom0_defs.h"
4 #include "mem_defs.h"
6 static char *argv0 = "internal_domain_start";
8 static int start_domain(int id)
9 {
10 int err;
11 dom0_op_t op;
13 op.cmd = DOM0_STARTDOMAIN;
14 op.u.meminfo.domain = id;
16 err = do_dom0_op(&op);
18 return (err < 0) ? -1 : 0;
19 }
21 int main(int argc, char **argv)
22 {
23 int rc, dom;
25 if ( argv[0] != NULL )
26 argv0 = argv[0];
28 if ( argc != 2 )
29 {
30 fprintf(stderr, "Usage: %s <domain-id>\n", argv0);
31 return 1;
32 }
34 dom = atoi(argv[1]);
35 if ( dom == 0 )
36 {
37 ERROR("Did you really mean domain 0?");
38 return 1;
39 }
41 rc = start_domain(dom);;
43 return (rc != 0) ? 1 : 0;
44 }