From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: jusual@mail.ru, qemu-devel <qemu-devel@nongnu.org>,
"Blake, Eric" <eblake@redhat.com>,
"Bonzini, Paolo" <pbonzini@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
joel@jms.id.au, jim@groklearning.com, mail@steffen-goertz.de
Subject: Re: [Qemu-devel] [PATCH v3 2/3] chardev: Add websocket support
Date: Fri, 19 Oct 2018 11:59:34 +0100 [thread overview]
Message-ID: <20181019105934.GJ13722@redhat.com> (raw)
In-Reply-To: <CAMxuvawyME-vDek6mcbfwLcCE1iE9AmqUgu1_r+Ka9ejZyGodQ@mail.gmail.com>
On Fri, Oct 19, 2018 at 02:15:10PM +0400, Marc-André Lureau wrote:
> Hi
>
> On Fri, Oct 19, 2018 at 2:35 AM Julia Suvorova <jusual@mail.ru> wrote:
> >
> > New option "websocket" added to allow using WebSocket protocol for
> > chardev socket backend.
> > Example:
> > -chardev socket,websocket,server,id=...
> >
> > Signed-off-by: Julia Suvorova <jusual@mail.ru>
> > ---
> > chardev/char-socket.c | 64 ++++++++++++++++++++++++++++++++++++++-----
> > chardev/char.c | 8 +++++-
> > qapi/char.json | 3 ++
> > qemu-options.hx | 13 +++++++--
> > 4 files changed, 77 insertions(+), 11 deletions(-)
> >
> > diff --git a/chardev/char-socket.c b/chardev/char-socket.c
> > index effde65a89..ba4ae9dfb0 100644
> > --- a/chardev/char-socket.c
> > +++ b/chardev/char-socket.c
> > @@ -26,6 +26,7 @@
> > #include "chardev/char.h"
> > #include "io/channel-socket.h"
> > #include "io/channel-tls.h"
> > +#include "io/channel-websock.h"
> > #include "io/net-listener.h"
> > #include "qemu/error-report.h"
> > #include "qemu/option.h"
> > @@ -68,6 +69,8 @@ typedef struct {
> > GSource *telnet_source;
> > TCPChardevTelnetInit *telnet_init;
> >
> > + bool is_websock;
> > +
> > GSource *reconnect_timer;
> > int64_t reconnect_time;
> > bool connect_err_reported;
> > @@ -394,7 +397,7 @@ static const char *qemu_chr_socket_protocol(SocketChardev *s)
> > if (s->is_telnet) {
> > return "telnet";
> > }
> > - return "tcp";
> > + return s->is_websock ? "websocket" : "tcp";
> > }
> >
> > static char *qemu_chr_socket_address(SocketChardev *s, const char *prefix)
> > @@ -714,6 +717,41 @@ cont:
> > }
> >
> >
> > +static void tcp_chr_websock_handshake(QIOTask *task, gpointer user_data)
> > +{
> > + Chardev *chr = user_data;
> > + SocketChardev *s = user_data;
> > +
> > + if (qio_task_propagate_error(task, NULL)) {
> > + tcp_chr_disconnect(chr);
>
> What about error_report() the error?
None of the rest of the code (telnet, tls, and other i/o related
funcs) uses error_report(). In some ways this is good as it
prevents a client app from flooding the qemu log file. It does
make debugging harder though when things are not working as
expected.
I wonder if we should add a tracing probe point in the
error_setg* methods in util/error.c ? There's quite a few
places in QEMU that discard errors which could benefit from
this when debugging.
I don't think it needs to blck this patch though.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2018-10-19 10:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-18 22:34 [Qemu-devel] [PATCH v3 0/3] chardev: Add websocket support Julia Suvorova
2018-10-18 22:34 ` [Qemu-devel] [PATCH v3 1/3] chardev/char-socket: Function headers refactoring Julia Suvorova
2018-10-19 10:15 ` Marc-André Lureau
2018-10-19 10:53 ` Daniel P. Berrangé
2018-10-18 22:35 ` [Qemu-devel] [PATCH v3 2/3] chardev: Add websocket support Julia Suvorova
2018-10-19 10:15 ` Marc-André Lureau
2018-10-19 10:59 ` Daniel P. Berrangé [this message]
2018-10-19 10:59 ` Daniel P. Berrangé
2018-10-18 22:35 ` [Qemu-devel] [PATCH v3 3/3] tests/test-char: Check websocket chardev functionality Julia Suvorova
2018-10-19 10:14 ` Marc-André Lureau
2018-10-19 11:02 ` Daniel P. Berrangé
2018-10-19 11:43 ` [Qemu-devel] [PATCH v3 0/3] chardev: Add websocket support Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181019105934.GJ13722@redhat.com \
--to=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=jim@groklearning.com \
--cc=joel@jms.id.au \
--cc=jusual@mail.ru \
--cc=mail@steffen-goertz.de \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.