debuggers.hg

view tools/internal/xi_start.c @ 648:cda951fc1bef

bitkeeper revision 1.341 (3f1120a2WW6KGE81TArq_p654xy38Q)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/iap10/xeno-clone/xeno.bk
author iap10@labyrinth.cl.cam.ac.uk
date Sun Jul 13 09:04:34 2003 +0000 (2003-07-13)
parents 49232d5003e6 9339f3942f4e
children b344838eb409 e09b8abaa2e3
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;
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 rc = start_domain(atol(argv[1]));
36 return (rc != 0) ? 1 : 0;
37 }