From patchwork Mon Apr 15 16:33:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1085739 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44jYx33M08z9s47 for ; Tue, 16 Apr 2019 02:34:15 +1000 (AEST) Received: from localhost ([127.0.0.1]:53005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hG4Yf-00028T-GK for incoming@patchwork.ozlabs.org; Mon, 15 Apr 2019 12:34:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hG4YI-000288-Nv for qemu-devel@nongnu.org; Mon, 15 Apr 2019 12:33:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hG4YG-0006XH-Qk for qemu-devel@nongnu.org; Mon, 15 Apr 2019 12:33:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33314) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hG4YE-0006Ux-TQ for qemu-devel@nongnu.org; Mon, 15 Apr 2019 12:33:48 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F0FC3097063 for ; Mon, 15 Apr 2019 16:33:45 +0000 (UTC) Received: from localhost (unknown [10.36.112.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B6465D733; Mon, 15 Apr 2019 16:33:37 +0000 (UTC) From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= To: qemu-devel@nongnu.org Date: Mon, 15 Apr 2019 18:33:36 +0200 Message-Id: <20190415163337.2795-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 15 Apr 2019 16:33:45 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4] socket: allow wait=false for client socket X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "reviewer:Incompatible changes" , =?utf-8?q?Ma?= =?utf-8?q?rc-Andr=C3=A9_Lureau?= , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Commit 767abe7 ("chardev: forbid 'wait' option with client sockets") is a bit too strict. Current libvirt always set wait=false, and will thus fail to add client chardev. Make the code more permissive, allowing wait=false with client socket chardevs. Deprecate usage of 'wait' with client sockets. Fixes: 767abe7f49e8be14d29da5db3527817b5d696a52 Cc: Daniel P. Berrangé Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- chardev/char-socket.c | 12 ++++++++---- qemu-deprecated.texi | 5 +++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 3916505d67..b2cf593107 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1263,10 +1263,14 @@ static bool qmp_chardev_validate_socket(ChardevSocket *sock, return false; } if (sock->has_wait) { - error_setg(errp, "%s", - "'wait' option is incompatible with " - "socket in client connect mode"); - return false; + warn_report("'wait' option is deprecated with " + "socket in client connect mode"); + if (sock->wait) { + error_setg(errp, "%s", + "'wait' option is incompatible with " + "socket in client connect mode"); + return false; + } } } diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 2219386769..842e71b11d 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -105,6 +105,11 @@ details. The ``query-events'' command has been superseded by the more powerful and accurate ``query-qmp-schema'' command. +@subsection chardev client socket with 'wait' option (since 4.0) + +Character devices creating sockets in client mode should not specify +the 'wait' field, which is only applicable to sockets in server mode + @section Human Monitor Protocol (HMP) commands @subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1)