ia64/xen-unstable

view tools/internal/xi_vbd_add.c @ 929:d684fdc4329e

bitkeeper revision 1.589.1.1 (3fb01fd6z-bXVPc8graC98kD6hySjA)

add Steve's new xi_vbd_tools to fix last checkin
author iap10@labyrinth.cl.cam.ac.uk
date Mon Nov 10 23:31:34 2003 +0000 (2003-11-10)
parents
children 5e91938ceb1b
line source
2 #define _GNU_SOURCE
3 #include "dom0_defs.h"
5 /*
6 ** Add an extent to a VBD; the VBD must have been created previously.
7 */
8 int main(int argc, char *argv[])
9 {
10 block_io_op_t op;
11 unsigned int domain;
12 unsigned short vdevice, device;
13 int ret;
15 if ( argc != 6 )
16 {
17 fprintf(stderr, "Usage: xi_vbd_add <domain> <vdevice> <device>"
18 "<start sector> <nr_sectors>\n");
19 return 1;
20 }
23 domain = atoi(argv[1]);
24 device = atoi(argv[2]);
25 vdevice = atoi(argv[3]);
27 op.cmd = BLOCK_IO_OP_VBD_ADD;
28 op.u.add_params.domain = domain;
29 op.u.add_params.vdevice = vdevice;
31 op.u.add_params.extent.device = device;
32 op.u.add_params.extent.start_sector = atol(argv[4]);
33 op.u.add_params.extent.nr_sectors = atol(argv[5]);
35 ret = do_block_io_op(&op);
37 if(ret < 0) {
38 fprintf(stderr, "error %d attempting to add extent to VBD %04x\n",
39 ret, atoi(argv[2]));
40 return ret;
41 }
43 return 0;
44 }