vl: Enable JSON syntax for -device
commit5dacda5167560b3af8eadbce5814f60ba44b467e
authorKevin Wolf <kwolf@redhat.com>
Fri, 8 Oct 2021 13:34:42 +0000 (8 15:34 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 15 Oct 2021 14:11:22 +0000 (15 16:11 +0200)
treee4e2c1b73c3751ecfe1d382a10eab5aef02d274c
parentf3558b1b763683bb877f7dd5b282469cdadc65c3
vl: Enable JSON syntax for -device

Like we already do for -object, introduce support for JSON syntax in
-device, which can be kept stable in the long term and guarantees that a
single code path with identical behaviour is used for both QMP and the
command line. Compared to the QemuOpts based code, the parser contains
less surprises and has support for non-scalar options (lists and
structs). Switching management tools to JSON means that we can more
easily change the "human" CLI syntax from QemuOpts to the keyval parser
later.

In the QAPI schema, a feature flag is added to the device-add command to
allow management tools to detect support for this.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20211008133442.141332-16-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qapi/qdev.json
softmmu/vl.c