qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v1 03/26] char-socket: fix the client mode when created t


From: Adalbert Lazăr
Subject: Re: [RFC PATCH v1 03/26] char-socket: fix the client mode when created through QMP
Date: Wed, 15 Apr 2020 14:47:26 +0300
User-agent: void

On Wed, 15 Apr 2020 12:37:34 +0200, Marc-André Lureau <address@hidden> wrote:
> Hi
> 
> On Wed, Apr 15, 2020 at 3:00 AM Adalbert Lazăr <address@hidden> wrote:
> >
> > qmp_chardev_open_socket() ignores the absence of the 'server' argument
> > and always switches to listen/server mode.
> >
> > CC: "Marc-André Lureau" <address@hidden>
> > CC: Paolo Bonzini <address@hidden>
> > Signed-off-by: Adalbert Lazăr <address@hidden>
> > ---
> >  chardev/char-socket.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/chardev/char-socket.c b/chardev/char-socket.c
> > index 9b2deb0125..fd0106ab85 100644
> > --- a/chardev/char-socket.c
> > +++ b/chardev/char-socket.c
> > @@ -1310,7 +1310,7 @@ static void qmp_chardev_open_socket(Chardev *chr,
> >      SocketChardev *s = SOCKET_CHARDEV(chr);
> >      ChardevSocket *sock = backend->u.socket.data;
> >      bool do_nodelay     = sock->has_nodelay ? sock->nodelay : false;
> > -    bool is_listen      = sock->has_server  ? sock->server  : true;
> > +    bool is_listen      = sock->has_server  ? sock->server  : false;
> 
> I don't understand what you mean. It defaults to server mode. We can't
> change that.

First of all, thanks for your comments.

I understand that a chardev socket is either in client mode or in server
mode.  If the 'server' parameter is not used, the socket is put in client
mode. At least this is the behavior when the socket is created by parsing
the command line. But, when created through QMP, without the 'server' parameter,
the socket is put in server mode.

Until this moment, I did not think that we can use "server=no" through QMP :))

So, yes. We may create the socket in client mode through QMP without this patch.

> 
> >      bool is_telnet      = sock->has_telnet  ? sock->telnet  : false;
> >      bool is_tn3270      = sock->has_tn3270  ? sock->tn3270  : false;
> >      bool is_waitconnect = sock->has_wait    ? sock->wait    : false;
> >
> 
> 
> -- 
> Marc-André Lureau
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]