nvmed: do not add unsupported features to featureCollection on capability query error

When querying feature capabilities (SEL=011b) during feature discovery,
if the drive returns an error (such as Invalid Field in Command 0x02),
do not add the feature to featureCollection. Advertising unsupported
features causes Redfish and busctl queries to attempt unsupported NVMe
commands, resulting in Service Unavailable and 500 Internal Error.

Tested: Ran unit tests and verified on target hardware.
Google-Bug-Id: 544517012
Change-Id: Ic699209edd0d819190fde0342459c4396a6a6964
Signed-off-by: Guangzong Chen <guangzong@google.com>
TAG=agy
CONV=322d2541-0ab6-49b1-8c8f-2aeba2f83067
1 file changed