.\" Title: nvme-io-passthru
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 02/02/2015
+.\" Date: 02/06/2015
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "NVME\-IO\-PASSTHRU" "1" "02/02/2015" "\ \&" "\ \&"
+.TH "NVME\-IO\-PASSTHRU" "1" "02/06/2015" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
The metadata length for the buffer used for this command\&.
.RE
.PP
-\-s, \-\-show\-cmd, \-\-dry\-run
+\-s, \-\-show\-cmd
.RS 4
-Do not actually send the command; print out the command that would be sent\&.
+Print out the command to be sent\&.
+.RE
+.PP
+\-d, \-\-dry\-run
+.RS 4
+Do not actually send the command\&.
.RE
.PP
\-b, \-\-raw\-binary
.RE
.SH "EXAMPLES"
.sp
-No examples yet\&.
+nvme io\-passthru /dev/nvme0n1 \-\-opcode=2 \-\-namespace\-id=1 \-\-data\-len=4096 \-\-read \-\-cdw10=0 \-\-cdw11=0 \-\-cdw12=0x70000 \-\-raw\-binary
.SH "NVME"
.sp
Part of the nvme\-user suite
static int nvme_passthru(int argc, char **argv, int ioctl_cmd)
{
int r = 0, w = 0;
- int opt, err, raw = 0, show = 0, long_index = 0, wfd = STDIN_FILENO;
+ int opt, err, raw = 0, show = 0, dry_run = 0, long_index = 0, wfd = STDIN_FILENO;
struct nvme_passthru_cmd cmd;
static struct option opts[] = {
{"opcode", required_argument, 0, 'o'},
{"cdw15", required_argument, 0, '9'},
{"raw-binary", no_argument, 0, 'b'},
{"show-command", no_argument, 0, 's'},
- {"dry-run", no_argument, 0, 's'},
+ {"dry-run", no_argument, 0, 'd'},
{"read", no_argument, 0, 'r'},
{"write", no_argument, 0, 'w'},
{"input-file", no_argument, 0, 'i'},
};
memset(&cmd, 0, sizeof(cmd));
- while ((opt = getopt_long(argc, (char **)argv, "o:n:f:l:R:m:t:i:bsrw", opts,
+ while ((opt = getopt_long(argc, (char **)argv, "o:n:f:l:R:m:t:i:bsdrw", opts,
&long_index)) != -1) {
switch (opt) {
case '2': get_int(optarg, &cmd.cdw2); break;
case 't': get_int(optarg, &cmd.timeout_ms); break;
case 'b': raw = 1; break;
case 's': show = 1; break;
+ case 'd': dry_run = 1; break;
case 'r': r = 1; break;
case 'w': w = 1; break;
case 'i':
printf("cdw14 : %08x\n", cmd.cdw14);
printf("cdw15 : %08x\n", cmd.cdw15);
printf("timeout_ms : %08x\n", cmd.timeout_ms);
- return 0;
+ if (dry_run)
+ return 0;
}
err = ioctl(fd, ioctl_cmd, &cmd);
if (err >= 0) {