Skip to content

Commit 64e5df3

Browse files
ikegami-tigaw
authored andcommitted
dapustor: enable dapustor-nvme.c build without json-c dependencies checkin
Only build json print codes with CONFIG_JSONC build option instead. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 8919109 commit 64e5df3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

plugins/dapustor/dapustor-nvme.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ struct nvme_extended_additional_smart_log {
9696
struct nvme_additional_smart_log_item inflight_write_io_cmd;
9797
};
9898

99+
#ifdef CONFIG_JSONC
99100
static void show_dapustor_add_smart_log_jsn(struct nvme_additional_smart_log *smart,
100101
struct json_object *dev_stats)
101102
{
@@ -348,6 +349,9 @@ static void show_dapustor_smart_log_jsn(struct nvme_additional_smart_log *smart,
348349
json_print_object(root, NULL);
349350
json_free_object(root);
350351
}
352+
#else /* CONFIG_JSONC */
353+
#define show_dapustor_smart_log_jsn(smart, ext_smart, nsid, devname, has_ext)
354+
#endif /* CONFIG_JSONC */
351355

352356
static void show_dapustor_add_smart_log(struct nvme_additional_smart_log *smart)
353357
{
@@ -505,7 +509,9 @@ static int dapustor_additional_smart_log(int argc, char **argv, struct command *
505509
const char *desc = "Get DapuStor vendor specific additional smart log, and show it.";
506510
const char *namespace = "(optional) desired namespace";
507511
const char *raw = "Dump output in binary format";
512+
#ifdef CONFIG_JSONC
508513
const char *json = "Dump output in json format";
514+
#endif /* CONFIG_JSONC */
509515

510516
struct nvme_additional_smart_log smart_log;
511517
struct nvme_extended_additional_smart_log ext_smart_log;
@@ -526,7 +532,9 @@ static int dapustor_additional_smart_log(int argc, char **argv, struct command *
526532
OPT_ARGS(opts) = {
527533
OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace),
528534
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
535+
#ifdef CONFIG_JSONC
529536
OPT_FLAG("json", 'j', &cfg.json, json),
537+
#endif /* CONFIG_JSONC */
530538
OPT_END()
531539
};
532540

plugins/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
if json_c_dep.found()
44
sources += [
5-
'plugins/dapustor/dapustor-nvme.c',
65
'plugins/dell/dell-nvme.c',
76
'plugins/fdp/fdp.c',
87
'plugins/huawei/huawei-nvme.c',
@@ -23,6 +22,7 @@ endif
2322

2423
sources += [
2524
'plugins/amzn/amzn-nvme.c',
25+
'plugins/dapustor/dapustor-nvme.c',
2626
'plugins/dera/dera-nvme.c',
2727
'plugins/innogrit/innogrit-nvme.c',
2828
'plugins/inspur/inspur-nvme.c',

0 commit comments

Comments
 (0)