]> git.proxmox.com Git - mirror_iproute2.git/commit
tc/mqprio: json-ify output
authorLuca Boccassi <bluca@debian.org>
Wed, 2 Dec 2020 17:08:45 +0000 (17:08 +0000)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 3 Dec 2020 16:32:42 +0000 (08:32 -0800)
commit755b1c584eeed60767f79fafb935f6ec1f8a4b75
tree7ca7c85faca4ac51d74964cd61505f0bc2279021
parent975c4944e8d57b9f51960611e2bc2c0da6cd6864
tc/mqprio: json-ify output

As reported by a Debian user, mqprio output in json mode is
invalid:

{
     "kind": "mqprio",
     "handle": "8021:",
     "dev": "enp1s0f0",
     "root": true,
     "options": { tc 2 map 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0
          queues:(0:3) (4:7)
          mode:channel
          shaper:dcb}
}

json-ify it, while trying to maintain the same formatting
for standard output.

New output:

{
    "kind": "mqprio",
    "handle": "8001:",
    "root": true,
    "options": {
        "tc": 2,
        "map": [ 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
        "queues": [ [ 0, 3 ], [ 4, 7 ] ],
        "mode": "channel",
        "shaper": "dcb"
    }
}

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972784

Reported-by: Roméo GINON <romeo.ginon@ilexia.com>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/q_mqprio.c