Skip to content

Commit 99e9b94

Browse files
committed
src: rework nvme_virtual_mgmt command
libnvme changed the API for the nvme_virtual_mgmt command. Update the callsite accordingly. Signed-off-by: Markus Kurz <[email protected]>
1 parent 3551e45 commit 99e9b94

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

nvme.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4329,8 +4329,9 @@ static int virtual_mgmt(int argc, char **argv, struct command *acmd, struct plug
43294329
"9h: Secondary Online";
43304330
const char *nr = "Number of Controller Resources(NR)";
43314331

4332-
_cleanup_nvme_global_ctx_ struct nvme_global_ctx *ctx = NULL;
43334332
_cleanup_nvme_transport_handle_ struct nvme_transport_handle *hdl = NULL;
4333+
_cleanup_nvme_global_ctx_ struct nvme_global_ctx *ctx = NULL;
4334+
struct nvme_passthru_cmd cmd;
43344335
__u32 result;
43354336
int err;
43364337

@@ -4358,16 +4359,8 @@ static int virtual_mgmt(int argc, char **argv, struct command *acmd, struct plug
43584359
if (err)
43594360
return err;
43604361

4361-
struct nvme_virtual_mgmt_args args = {
4362-
.args_size = sizeof(args),
4363-
.act = cfg.act,
4364-
.rt = cfg.rt,
4365-
.cntlid = cfg.cntlid,
4366-
.nr = cfg.nr,
4367-
.timeout = nvme_cfg.timeout,
4368-
.result = &result,
4369-
};
4370-
err = nvme_virtual_mgmt(hdl, &args);
4362+
nvme_init_virtual_mgmt(&cmd, cfg.act, cfg.rt, cfg.cntlid, cfg.nr);
4363+
err = nvme_submit_admin_passthru(hdl, &cmd, &result);
43714364
if (!err)
43724365
printf("success, Number of Controller Resources Modified (NRM):%#x\n", result);
43734366
else if (err > 0)

0 commit comments

Comments
 (0)