@@ -102,7 +102,6 @@ struct passthru_config {
102102 char * metadata ;
103103 bool raw_binary ;
104104 bool show_command ;
105- bool dry_run ;
106105 bool read ;
107106 bool write ;
108107 __u8 prefill ;
@@ -192,6 +191,7 @@ const char *output_format = "Output format: normal|binary";
192191#endif /* CONFIG_JSONC */
193192const char * timeout = "timeout value, in milliseconds" ;
194193const char * verbose = "Increase output verbosity" ;
194+ const char * dry_run = "show command instead of sending" ;
195195
196196static const char * app_tag = "app tag for end-to-end PI" ;
197197static const char * app_tag_mask = "app tag mask for end-to-end PI" ;
@@ -201,7 +201,6 @@ static const char *csi = "command set identifier";
201201static const char * buf_len = "buffer len (if) data is sent or received" ;
202202static const char * domainid = "Domain Identifier" ;
203203static const char * doper = "directive operation" ;
204- static const char * dry = "show command instead of sending" ;
205204static const char * dspec_w_dtype = "directive specification associated with directive type" ;
206205static const char * dtype = "directive type" ;
207206static const char * endgid = "Endurance Group Identifier (ENDGID)" ;
@@ -445,6 +444,8 @@ static int parse_args(int argc, char *argv[], const char *desc,
445444 log_level = map_log_level (nvme_cfg .verbose , false);
446445 nvme_init_default_logging (stderr , log_level , false, false);
447446
447+ set_dry_run (nvme_cfg .dry_run );
448+
448449 return 0 ;
449450}
450451
@@ -8060,7 +8061,6 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char
80608061 __u16 dspec ;
80618062 __u8 dsmgmt ;
80628063 bool show ;
8063- bool dry_run ;
80648064 bool latency ;
80658065 bool force ;
80668066 };
@@ -8085,7 +8085,6 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char
80858085 .dspec = 0 ,
80868086 .dsmgmt = 0 ,
80878087 .show = false,
8088- .dry_run = false,
80898088 .latency = false,
80908089 .force = false,
80918090 };
@@ -8110,7 +8109,7 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char
81108109 OPT_SHRT ("dir-spec" , 'S' , & cfg .dspec , dspec ),
81118110 OPT_BYTE ("dsm" , 'D' , & cfg .dsmgmt , dsm ),
81128111 OPT_FLAG ("show-command" , 'V' , & cfg .show , show ),
8113- OPT_FLAG ("dry-run" , 'w' , & cfg .dry_run , dry ),
8112+ OPT_FLAG ("dry-run" , 'w' , & nvme_cfg .dry_run , dry_run ),
81148113 OPT_FLAG ("latency" , 't' , & cfg .latency , latency ),
81158114 OPT_FLAG ("force" , 0 , & cfg .force , force ));
81168115
@@ -8286,7 +8285,7 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char
82868285 }
82878286 }
82888287
8289- if (cfg .show || cfg .dry_run ) {
8288+ if (cfg .show || nvme_cfg .dry_run ) {
82908289 printf ("opcode : %02x\n" , opcode );
82918290 printf ("nsid : %02x\n" , cfg .namespace_id );
82928291 printf ("flags : %02x\n" , 0 );
@@ -8304,7 +8303,7 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char
83048303 printf ("pif : %02x\n" , pif );
83058304 printf ("sts : %02x\n" , sts );
83068305 }
8307- if (cfg .dry_run )
8306+ if (nvme_cfg .dry_run )
83088307 return 0 ;
83098308
83108309 struct nvme_io_args args = {
@@ -9069,7 +9068,6 @@ static int passthru(int argc, char **argv, bool admin,
90699068 .metadata = "" ,
90709069 .raw_binary = false,
90719070 .show_command = false,
9072- .dry_run = false,
90739071 .read = false,
90749072 .write = false,
90759073 .latency = false,
@@ -9095,7 +9093,7 @@ static int passthru(int argc, char **argv, bool admin,
90959093 OPT_FILE ("metadata" , 'M' , & cfg .metadata , metadata ),
90969094 OPT_FLAG ("raw-binary" , 'b' , & cfg .raw_binary , raw_dump ),
90979095 OPT_FLAG ("show-command" , 's' , & cfg .show_command , show ),
9098- OPT_FLAG ("dry-run" , 'd' , & cfg .dry_run , dry ),
9096+ OPT_FLAG ("dry-run" , 'd' , & nvme_cfg .dry_run , dry_run ),
90999097 OPT_FLAG ("read" , 'r' , & cfg .read , re ),
91009098 OPT_FLAG ("write" , 'w' , & cfg .write , wr ),
91019099 OPT_FLAG ("latency" , 'T' , & cfg .latency , latency ));
@@ -9172,7 +9170,7 @@ static int passthru(int argc, char **argv, bool admin,
91729170 }
91739171 }
91749172
9175- if (cfg .show_command || cfg .dry_run ) {
9173+ if (cfg .show_command || nvme_cfg .dry_run ) {
91769174 printf ("opcode : %02x\n" , cfg .opcode );
91779175 printf ("flags : %02x\n" , cfg .flags );
91789176 printf ("rsvd1 : %04x\n" , cfg .rsvd );
@@ -9191,7 +9189,7 @@ static int passthru(int argc, char **argv, bool admin,
91919189 printf ("cdw15 : %08x\n" , cfg .cdw15 );
91929190 printf ("timeout_ms : %08x\n" , nvme_cfg .timeout );
91939191 }
9194- if (cfg .dry_run )
9192+ if (nvme_cfg .dry_run )
91959193 return 0 ;
91969194
91979195 gettimeofday (& start_time , NULL );
0 commit comments