add display of map information in JSON format
authorTodd Gill <tgill@redhat.com>
Tue, 24 May 2016 18:03:07 +0000 (14:03 -0400)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 1 Jun 2016 14:54:28 +0000 (16:54 +0200)
commit8fb53a78f19069556edc5e1f1f30f9f58e4f43e8
tree42f4dd50efb761b2809cbc86fc7390822566a232
parent22fdf6bc06659c6e3f7492a6fcabcc3cd2732e24
add display of map information in JSON format

The changes add these commands:

multipathd show maps json
multipathd show map $map json

Each command will output the requested map(s) in JSON.

For the "show maps json" command, the change pre-allocates
INITIAL_REPLY_LEN * PRINT_JSON_MULTIPLIER(5) * map count.
The JSON text is about 5x the size of the "show maps topology"
text.  Multiplying by the map count helps decrease the number
of realloc calls.

Signed-off-by: Todd Gill <tgill@redhat.com>
Signed-off-by: Gris Ge <fge@redhat.com>
libmultipath/print.c
libmultipath/print.h
multipathd/cli.c
multipathd/cli.h
multipathd/cli_handlers.c
multipathd/cli_handlers.h
multipathd/main.c