[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] chardev: Add websocket support
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] chardev: Add websocket support |
Date: |
Tue, 14 Aug 2018 17:11:13 +0100 |
On Mon, Aug 13, 2018 at 11:20 AM Julia Suvorova <address@hidden> wrote:
> New option "websock" added to allow using websocket protocol for
> chardev socket backend.
> Example:
> -chardev socket,websock,id=...
>
> Signed-off-by: Julia Suvorova <address@hidden>
> ---
> chardev/char-socket.c | 75 ++++++++++++++++++++++++++++++++++++-------
> chardev/char.c | 3 ++
> qapi/char.json | 3 ++
> 3 files changed, 70 insertions(+), 11 deletions(-)
Is there a tests/test-char.c test case for this? Transmit, receive,
and closing the connection can be tested.
> +static void tcp_chr_websock_init(Chardev *chr)
> +{
> + SocketChardev *s = SOCKET_CHARDEV(chr);
> + QIOChannelWebsock *wioc;
> + gchar *name;
> +
> + if (s->is_listen) {
> + wioc = qio_channel_websock_new_server(s->ioc);
> + } else {
> + /* Websocket client is not yet implemented */
> + return;
What happens in this error case? Does the user get a useful error?
If not, it may be necessary to pass Error *errp through so this
function can report that initialization failed because client mode is
not implemented.