]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ip: xstats: add json output support
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Tue, 12 Mar 2019 16:41:26 +0000 (18:41 +0200)
committerDavid Ahern <dsahern@gmail.com>
Fri, 15 Mar 2019 20:55:57 +0000 (13:55 -0700)
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>
Signed-off-by: David Ahern <dsahern@gmail.com>
ip/iplink_xstats.c

index 908d9228369f3753a220ef25d8b568ee6ac810ff..c64e6885678c6f20f672be920fe3de3f68afd851 100644 (file)
@@ -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;
 }