@@ -278,10 +278,11 @@ static int lm_migration_send(int argc, char **argv, struct command *acmd, struct
278278 const char * numd = "Number of Dwords (NUMD)" ;
279279 const char * input = "Controller State Data input file" ;
280280
281- _cleanup_nvme_global_ctx_ struct nvme_global_ctx * ctx = NULL ;
282281 _cleanup_nvme_transport_handle_ struct nvme_transport_handle * hdl = NULL ;
283- _cleanup_file_ FILE * file = NULL ;
282+ _cleanup_nvme_global_ctx_ struct nvme_global_ctx * ctx = NULL ;
284283 _cleanup_huge_ struct nvme_mem_huge mh = { 0 , };
284+ _cleanup_file_ FILE * file = NULL ;
285+ struct nvme_passthru_cmd cmd ;
285286 void * data = NULL ;
286287 int err = -1 ;
287288
@@ -377,21 +378,12 @@ static int lm_migration_send(int argc, char **argv, struct command *acmd, struct
377378 }
378379 }
379380
380- struct nvme_lm_migration_send_args args = {
381- .args_size = sizeof (args ),
382- .sel = cfg .sel ,
383- .mos = NVME_SET (cfg .seqind , LM_SEQIND ),
384- .cntlid = cfg .cntlid ,
385- .csuuidi = cfg .csuuidi ,
386- .uidx = cfg .uidx ,
387- .stype = cfg .stype ,
388- .offset = cfg .offset ,
389- .dudmq = cfg .dudmq ,
390- .numd = cfg .numd ,
391- .data = data ,
392- };
393-
394- err = nvme_lm_migration_send (hdl , & args );
381+ nvme_init_lm_migration_send (& cmd , cfg .sel ,
382+ NVME_SET (cfg .seqind , LM_SEQIND ), cfg .cntlid ,
383+ cfg .stype , cfg .dudmq , cfg .csvi , cfg .csuuidi ,
384+ cfg .offset , cfg .uidx , data ,
385+ (cfg .numd << 2 ));
386+ err = nvme_submit_admin_passthru (hdl , & cmd , NULL );
395387 if (err < 0 )
396388 nvme_show_error ("ERROR: nvme_lm_migration_send() failed %s" , strerror (errno ));
397389 else if (err > 0 )
0 commit comments