Skip to content

Conversation

@ikegami-t
Copy link
Contributor

Use nvme_show_key_value() to output the message as json format.

Use nvme_show_key_value() to output the message as json format.

Signed-off-by: Tokunori Ikegami <[email protected]>
ikegami-t added 2 commits May 18, 2025 19:15
Add the json_init counter to create josn object exclusively.
Also change json_output_key_value() to trim key string white spaces.

Signed-off-by: Tokunori Ikegami <[email protected]>
Also change dev_close() to call nvme_show_finish() as same.

Signed-off-by: Tokunori Ikegami <[email protected]>

#include "logging.h"
#include "sighdl.h"
#include "nvme-print.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to avoid pulling in something from the parent directly into the util folder. Looking at what loggin.c does I suggest just move it to the parent folder.

util/logging.c Outdated

int log_level;
static bool dry_run;
static bool dry_run_state;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and then you can just directly use the dry_run. so you can delete this definition.

util/logging.c Outdated
{
dry_run = enable;
dry_run_state = enable;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also we don't need this setter anymore.

Use nvme_show_key_value() to output the message as json format.
Also changed to use nvme_cfg.dry_run instead of the dry_run.
And moved the logging.c to the pararent directly to pull.

Signed-off-by: Tokunori Ikegami <[email protected]>
@ikegami-t ikegami-t force-pushed the copy-success-json branch from 6b11862 to a3643d1 Compare May 19, 2025 14:15
@ikegami-t
Copy link
Contributor Author

Fixed as suggested. Thank you.

@igaw igaw merged commit ac005e7 into linux-nvme:master May 20, 2025
17 checks passed
@igaw
Copy link
Collaborator

igaw commented May 20, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants