linux-nvme / nvme-cli

NVMe management command line interface.
https://nvmexpress.org
GNU General Public License v2.0
1.41k stars 637 forks source link

plugins/ocp: Added ocp TCG Configuration Log Page #2361

Closed VigneshwaranSaravana closed 4 weeks ago

VigneshwaranSaravana commented 1 month ago

Reviewed-by: Karthik Balan karthik.b82@samsung.com, Arunpandian J arun.j@samsung.com

igaw commented 1 month ago

There are a lot of warning/errors when building with gcc in release mode:

../plugins/ocp/ocp-nvme.c:3464:29: error: array subscript ‘struct tcg_configuration_log[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds]
 3464 |                 if (log_data->log_page_version != C7_TCG_CONFIGURATION_LOG_VERSION) {
      |                     ~~~~~~~~^~~~~~~~~~~~~~~~~~
../plugins/ocp/ocp-nvme.c:3451:24: note: object of size 16 allocated by ‘malloc’
 3451 |         data = (__u8 *)malloc(sizeof(__u8) * C7_GUID_LENGTH);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../nvme.h:30,
[...]

Please have the signoff/reviewed tags one line per author/reviewer. Thanks.

@arthurshau, please have a look.

arthurshau commented 1 month ago

I unfortunately don't have a drive to test the new feature, but as long as vendor feels like they need the functionality, I have nothing against merging it. After fixing the compiler warnings of course.

igaw commented 4 weeks ago

I've updated the commit message and dropped the html generated documentation(will be generated on release date). Please have a close look how this PR is supposed to look like (commit message), so I don't have to fix this up myself. Thanks.