Instead of causing the show-regs command to fail if a property is
encountered that is not supported by the target side, do not display
the property. With this patch applied the following output is displayed
for the Linux NVMf target:
$ nvme show-regs /dev/nvme0
cap :
f0003ff
version : 10300
cc : 460001
csts : 1
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
memset(*pbar, 0xff, size);
for (offset = NVME_REG_CAP; offset <= NVME_REG_CMBSZ;) {
err = nvme_get_property(fd, offset, &value);
- if (err) {
+ if (err > 0 && (err & 0xff) == NVME_SC_INVALID_FIELD) {
+ err = 0;
+ value = -1;
+ } else if (err) {
free(*pbar);
break;
}