nvmecontrol: Report status from passthru commands

Report status from dword0 for passthru commands. Many commands report
some status or information here, so reporting it can help know what's
going on.

Sponsored by:		Netflix

(cherry picked from commit 510a3da147)
This commit is contained in:
Warner Losh 2021-03-25 01:41:53 -06:00
parent bf7ea64d79
commit abb811c40c

View File

@ -246,7 +246,8 @@ passthru(const struct cmd *f, int argc, char *argv[])
errno = 0;
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
err(EX_IOERR, "passthrough request failed");
/* XXX report status */
if (!opt.binary)
printf("DWORD0 status= %#x\n", pt.cpl.cdw0);
if (opt.read) {
if (opt.binary)
write(STDOUT_FILENO, data, opt.data_len);