On Mon, Aug 13, 2018 at 11:20 AM Julia Suvorova <jus...@mail.ru> wrote: > New option "websock" added to allow using websocket protocol for > chardev socket backend. > Example: > -chardev socket,websock,id=... > > Signed-off-by: Julia Suvorova <jus...@mail.ru> > --- > 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.