All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Yongji Xie" <elohimes@gmail.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 03/12] chardev: forbid 'wait' option with client sockets
Date: Wed, 16 Jan 2019 06:17:03 +0100	[thread overview]
Message-ID: <6f5b1e3a-2ef3-6c80-9e36-eea38092f155@redhat.com> (raw)
In-Reply-To: <20190115145256.9593-4-berrange@redhat.com>

On 2019-01-15 15:52, Daniel P. Berrangé wrote:
> The 'wait'/'nowait' parameter is used to tell server sockets whether to
> block until a client is accepted during initialization. Client chardevs
> have always silently ignored this option. Various tests were mistakenly
> passing this option for their client chardevs.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  chardev/char-socket.c          | 12 +++++++++++-
>  tests/ivshmem-test.c           |  2 +-
>  tests/libqtest.c               |  4 ++--
>  tests/test-filter-redirector.c |  4 ++--
>  4 files changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/chardev/char-socket.c b/chardev/char-socket.c
> index 4570755adf..233f16f72d 100644
> --- a/chardev/char-socket.c
> +++ b/chardev/char-socket.c
> @@ -1047,6 +1047,12 @@ static bool qmp_chardev_validate_socket(ChardevSocket *sock,
>              error_setg(errp, "%s", "Websocket client is not implemented");
>              return false;
>          }
> +        if (sock->has_wait) {
> +            error_setg(errp, "%s",
> +                       "'wait' option is incompatible with "
> +                       "socket in client connect mode");
> +            return false;
> +        }
>      }
>  
>      return true;
> @@ -1220,7 +1226,11 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend,
>      sock->tn3270 = is_tn3270;
>      sock->has_websocket = true;
>      sock->websocket = is_websock;
> -    sock->has_wait = true;
> +    /*
> +     * We have different default to QMP for 'wait' when 'server'
> +     * is set, hence we can't just check for existance of 'wait'
> +     */
> +    sock->has_wait = qemu_opt_find(opts, "wait") || is_listen;
>      sock->wait = is_waitconnect;
>      sock->has_reconnect = qemu_opt_find(opts, "reconnect");
>      sock->reconnect = reconnect;
> diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c
> index fe5eb304b1..faffc1c624 100644
> --- a/tests/ivshmem-test.c
> +++ b/tests/ivshmem-test.c
> @@ -293,7 +293,7 @@ static void *server_thread(void *data)
>  
>  static void setup_vm_with_server(IVState *s, int nvectors, bool msi)
>  {
> -    char *cmd = g_strdup_printf("-chardev socket,id=chr0,path=%s,nowait "
> +    char *cmd = g_strdup_printf("-chardev socket,id=chr0,path=%s "
>                                  "-device ivshmem%s,chardev=chr0,vectors=%d",
>                                  tmpserver,
>                                  msi ? "-doorbell" : ",size=1M,msi=off",

I think there will be a conflict with the patch 'Remove deprecated
"ivshmem" legacy device' that is currently in Michael's PULL request ...
could you please rebase this patch in a day or two once that PULL has
been merged?

Apart from that, patch looks fine to me.

Acked-by: Thomas Huth <thuth@redhat.com>

  parent reply	other threads:[~2019-01-16  5:17 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 14:52 [Qemu-devel] [PATCH 00/12] chardev: refactoring & many bugfixes related tcp_chr_wait_connected Daniel P. Berrangé
2019-01-15 14:52 ` [Qemu-devel] [PATCH 01/12] chardev: fix validation of options for QMP created chardevs Daniel P. Berrangé
2019-01-15 19:13   ` Marc-André Lureau
2019-01-16  5:07   ` Thomas Huth
2019-01-16  9:27     ` Daniel P. Berrangé
2019-01-17  9:21       ` Markus Armbruster
2019-01-17 14:13         ` Eric Blake
2019-01-15 14:52 ` [Qemu-devel] [PATCH 02/12] chardev: forbid 'reconnect' option with server sockets Daniel P. Berrangé
2019-01-15 19:13   ` Marc-André Lureau
2019-01-16  5:11   ` Thomas Huth
2019-01-15 14:52 ` [Qemu-devel] [PATCH 03/12] chardev: forbid 'wait' option with client sockets Daniel P. Berrangé
2019-01-15 19:14   ` Marc-André Lureau
2019-01-16  5:17   ` Thomas Huth [this message]
2019-01-15 14:52 ` [Qemu-devel] [PATCH 04/12] chardev: remove many local variables in qemu_chr_parse_socket Daniel P. Berrangé
2019-01-15 19:18   ` Marc-André Lureau
2019-01-16  9:33     ` Daniel P. Berrangé
2019-01-15 19:33   ` Eric Blake
2019-01-16  9:31     ` Daniel P. Berrangé
2019-01-15 14:52 ` [Qemu-devel] [PATCH 05/12] chardev: ensure qemu_chr_parse_compat reports missing driver error Daniel P. Berrangé
2019-01-15 19:20   ` Marc-André Lureau
2019-01-15 14:52 ` [Qemu-devel] [PATCH 06/12] chardev: remove unused 'sioc' variable & cleanup paths Daniel P. Berrangé
2019-01-15 19:39   ` Marc-André Lureau
2019-01-16  5:24   ` Thomas Huth
2019-01-16  5:47     ` Peter Xu
2019-01-16  6:01       ` Thomas Huth
2019-01-16  9:34     ` Daniel P. Berrangé
2019-01-15 14:52 ` [Qemu-devel] [PATCH 07/12] chardev: split tcp_chr_wait_connected into two methods Daniel P. Berrangé
2019-01-15 19:44   ` Marc-André Lureau
2019-01-16  9:36     ` Daniel P. Berrangé
2019-01-15 14:52 ` [Qemu-devel] [PATCH 08/12] chardev: split up qmp_chardev_open_socket connection code Daniel P. Berrangé
2019-01-15 21:02   ` Marc-André Lureau
2019-01-15 14:52 ` [Qemu-devel] [PATCH 09/12] chardev: use a state machine for socket connection state Daniel P. Berrangé
2019-01-15 21:05   ` Marc-André Lureau
2019-01-15 14:52 ` [Qemu-devel] [PATCH 10/12] chardev: honour the reconnect setting in tcp_chr_wait_connected Daniel P. Berrangé
2019-01-15 21:22   ` Marc-André Lureau
2019-01-15 14:52 ` [Qemu-devel] [PATCH 11/12] chardev: disallow TLS/telnet/websocket with tcp_chr_wait_connected Daniel P. Berrangé
2019-01-15 21:54   ` Marc-André Lureau
2019-01-16  9:37     ` Daniel P. Berrangé
2019-01-15 14:52 ` [Qemu-devel] [PATCH 12/12] chardev: fix race with client connections in tcp_chr_wait_connected Daniel P. Berrangé
2019-01-21  9:51 ` [Qemu-devel] [PATCH 00/12] chardev: refactoring & many bugfixes related tcp_chr_wait_connected no-reply

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=6f5b1e3a-2ef3-6c80-9e36-eea38092f155@redhat.com \
    --to=thuth@redhat.com \
    --cc=berrange@redhat.com \
    --cc=elohimes@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.