]>
git.ipfire.org Git - thirdparty/systemd.git/blob - extras/multipath/unused.c
4 unsigned char turCmdBlk
[TUR_CMD_LEN
] = { 0x00, 0, 0, 0, 0, 0 };
5 struct sg_io_hdr io_hdr
;
6 unsigned char sense_buffer
[32];
8 memset(&io_hdr
, 0, sizeof (struct sg_io_hdr
));
9 io_hdr
.interface_id
= 'S';
10 io_hdr
.cmd_len
= sizeof (turCmdBlk
);
11 io_hdr
.mx_sb_len
= sizeof (sense_buffer
);
12 io_hdr
.dxfer_direction
= SG_DXFER_NONE
;
13 io_hdr
.cmdp
= turCmdBlk
;
14 io_hdr
.sbp
= sense_buffer
;
15 io_hdr
.timeout
= 20000;
17 if (ioctl(fd
, SG_IO
, &io_hdr
) < 0) {
21 if (io_hdr
.info
& SG_INFO_OK_MASK
) {
31 if (!(dmt
= dm_task_create(DM_DEVICE_REMOVE
)))
33 if (!dm_task_set_name(dmt
, str
))
35 if (!dm_task_run(dmt
))
38 printf("Deleted device map : %s\n", str
);
45 get_table(const char * str
)
50 uint64_t start
, length
;
51 char *target_type
= NULL
;
54 if (!(dmt
= dm_task_create(DM_DEVICE_TABLE
)))
57 if (!dm_task_set_name(dmt
, str
))
60 if (!dm_task_run(dmt
))
64 next
= dm_get_next_target(dmt
, next
, &start
, &length
,
65 &target_type
, ¶ms
);
67 printf("%" PRIu64
" %" PRIu64
" %s %s\n",
68 start
, length
, target_type
, params
);