chardev: fix validation of options for QMP created chardevs
commit1645984b04fd8597ccdfc6e8530fd17d23f4cdf0
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 11 Feb 2019 18:24:29 +0000 (11 18:24 +0000)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 12 Feb 2019 16:35:56 +0000 (12 17:35 +0100)
tree30c1e116044ec6061be09dd6177987fb68c5a4ca
parentdbb44504c28683a4428308f72b9f61733fcda007
chardev: fix validation of options for QMP created chardevs

The TLS creds option is not valid with certain address types. The user
config was only checked for errors when parsing legacy QemuOpts, thus
the user could pass unsupported values via QMP.

Pull all code for validating options out into a new method
qmp_chardev_validate_socket, that is called from the main
qmp_chardev_open_socket method. This adds a missing check for rejecting
TLS creds with the vsock address type.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190211182442.8542-4-berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
chardev/char-socket.c