debuggers.hg

view tools/internal/xi_phys_revoke.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 83633bb4e30d 9339f3942f4e
children
line source
2 #define _GNU_SOURCE
3 #include "dom0_defs.h"
5 int main(int argc, char *argv[])
6 {
7 privcmd_blkmsg_t blkmsg;
8 xp_disk_t xpd;
10 if ( argc != 5 )
11 {
12 fprintf(stderr, "Usage: xi_physdev_revoke <domain> "
13 "<device> <start sector> <n_sectors>\n");
14 return 1;
15 }
17 xpd.mode = 0;
18 xpd.domain = atol(argv[1]);
19 xpd.device = xldev_to_physdev(atol(argv[2]));
20 xpd.start_sect = atol(argv[3]);
21 xpd.n_sectors = atol(argv[4]);
23 if ( xpd.device == 0 )
24 {
25 ERROR("Unrecognised device");
26 return 1;
27 }
29 blkmsg.op = XEN_BLOCK_PHYSDEV_GRANT;
30 blkmsg.buf = &xpd;
31 blkmsg.buf_size = sizeof(xpd);
33 if ( do_xen_blkmsg(&blkmsg) < 0 )
34 return 1;
36 return 0;
37 }