diff options
author | Alek P <[email protected]> | 2018-03-19 15:40:58 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-03-19 12:40:58 -0700 |
commit | 272b5d730f9ddd1db7cd7511da7bba75d6bd2450 (patch) | |
tree | 9c7d8a1e05571bc8b157427815e05fd65f1dfe91 /include/libnvpair.h | |
parent | a76f3d0437e5e974f0f748f8735af3539443b388 (diff) |
Add JSON output support to channel programs
The changes piggyback JSON output support on top of channel programs
(#6558). This way the JSON output support is targeted to scripting
use cases and is easily maintainable since it really only touches
one function (zfs_do_channel_program()).
This patch ports Joyent's JSON nvlist library from illumos to enable
easy JSON printing of channel program output nvlist. To keep the
delta small I also took advantage of the fact that printing in
zfs_do_channel_program() was almost always done before exiting
the program.
Reviewed by: Matt Ahrens <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Richard Elling <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Alek Pinchuk <[email protected]>
Closes #7281
Diffstat (limited to 'include/libnvpair.h')
-rw-r--r-- | include/libnvpair.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/libnvpair.h b/include/libnvpair.h index 4c2615d92..5277f9574 100644 --- a/include/libnvpair.h +++ b/include/libnvpair.h @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #ifndef _LIBNVPAIR_H @@ -46,6 +47,7 @@ extern int nvpair_value_match_regex(nvpair_t *, int, char *, regex_t *, char **); extern void nvlist_print(FILE *, nvlist_t *); +int nvlist_print_json(FILE *, nvlist_t *); extern void dump_nvlist(nvlist_t *, int); /* |