-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvme-print-json: Add remaining feature fields print functions #2088
Conversation
Could you split the change into two bits? One which updates the formatting/codying style and one which just adds the new code? It makes the review a bit simpler. Thanks! |
ff3809c
to
8465478
Compare
Thanks for your comment. Split the patch and added additional a patch to fix the get feature command mixed stdout and json outputs issue. |
9203476
to
719acc1
Compare
7c64b64
to
ff87e30
Compare
1d75925
to
db8e171
Compare
nvme-print-json.c
Outdated
|
||
#define array_add_obj(o, k) json_array_add_value_object(o, k); | ||
#define obj_add_str(o, k, v) json_object_add_value_string(o, k, v) | ||
#define root_add_array(k, v) json_object_add_value_array(root, k, v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if wouldn't make sense to just use r
instead of root
as variable name in the functions and the use obj_add_str(r, ..., ...)
instead introducing a wrapper macro just for this. What do you think?
As this series is pretty big and I don't want to make you suffer too much by updating every patch again, you can just add a cleanup patch add the end of the series, that is fine with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fixed by the commit 6575bf3.
The feature output is getting closer to be valid JSON:
{
"Feature":"0x01",
"Name":"Arbitration",
"Current":"0x03030302"
}
{
"Feature":"0x02",
"Name":"Power Management",
"Current":"0x00000003"
}
{
"Error":"get-feature:0x03 (LBA Range Type): "
}
{
"Error":"Invalid Namespace or Format: The namespace or the format of that namespace is invalid",
"Type":"nvme",
"Value":16395
}
{
"Feature":"0x04",
"Name":"Temperature Threshold",
"Current":"0x00000162"
}
{
"Error":"get-feature:0x05 (Error Recovery): "
}
{
"Error":"Invalid Namespace or Format: The namespace or the format of that namespace is invalid",
"Type":"nvme",
"Value":16395
}
{
"Feature":"0x06",
"Name":"Volatile Write Cache",
"Current":"0x00000001"
} We need to figure out how handle the error case above and all features should be reported in an array. There problem is the |
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
…add_***() Signed-off-by: Tokunori Ikegami <[email protected]>
…**() Signed-off-by: Tokunori Ikegami <[email protected]>
…dd_str() Signed-off-by: Tokunori Ikegami <[email protected]>
…dd_uint64() Signed-off-by: Tokunori Ikegami <[email protected]>
…int() Signed-off-by: Tokunori Ikegami <[email protected]>
…_uint() Signed-off-by: Tokunori Ikegami <[email protected]>
…d_array() Signed-off-by: Tokunori Ikegami <[email protected]>
…bj() Signed-off-by: Tokunori Ikegami <[email protected]>
…dd_obj() Signed-off-by: Tokunori Ikegami <[email protected]>
…add_uint128() Signed-off-by: Tokunori Ikegami <[email protected]>
…tr() Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
… registers Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
6575bf3
to
212fb60
Compare
Rebased with the master and fixed some conflicts. |
Noted about the show_feature API problem. Yes I thought also to use the global variable root json object in nvme-print-json to resolved the issue. Anyway later will do consider the suggestion also. Thank you. |
…tatus Signed-off-by: Tokunori Ikegami <[email protected]>
Note: Still error and data reported separately so will be fixed later. Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Signed-off-by: Tokunori Ikegami <[email protected]>
Thanks a lot. |
No description provided.