diff mbox series

[iproute2-next,1/3] ip: xstats: add json output support

Message ID 20190312164128.22536-2-nikolay@cumulusnetworks.com
State Accepted
Delegated to: David Ahern
Headers show
Series bond, bridge: add xstats json support | expand

Commit Message

Nikolay Aleksandrov March 12, 2019, 4:41 p.m. UTC
This adds only initial object support if json argument is specified.
Later patches convert the current xstats users to json.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 ip/iplink_xstats.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/ip/iplink_xstats.c b/ip/iplink_xstats.c
index 908d9228369f..c64e6885678c 100644
--- a/ip/iplink_xstats.c
+++ b/ip/iplink_xstats.c
@@ -70,10 +70,13 @@  int iplink_ifla_xstats(int argc, char **argv)
 		return -1;
 	}
 
+	new_json_obj(json);
 	if (rtnl_dump_filter(&rth, lu->print_ifla_xstats, stdout) < 0) {
+		delete_json_obj();
 		fprintf(stderr, "Dump terminated\n");
 		return -1;
 	}
+	delete_json_obj();
 
 	return 0;
 }