From nobody Sun Sep 28 16:35:50 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1758720853; cv=none; d=zohomail.com; s=zohoarc; b=cfvw9kNuZTBZi6rYtjV9yy4KhkzM+1KG1QVmCLceKojqqiUpwjYzP1/aSIW10BUQzAzi+BaQeGWGK5UMt8InzGm8Zp81a5ZZRiL84ptcIwh/HbBEW5oH9q5jTAZbIgduWtdJxS/Qevc3+rIYc71C2UBmJtX4+GkgrJBRdLdvs4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758720853; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=irCkse1XJDbrp3bOJle/wi2hzTP+EhpQQfGe4cGOV3s=; b=cz/QcGUBkkjbFhB7c/9JJVeFXs62mEAIpBRRFQoVUVVwh2PQP9rhgWDSVYBzM5aqqq5rMGS3YFLBRDj5LLqutj2oWZb9wCZG05rJPZOcAbi7ild+oSH8LPE6bKkLvn7MkKJV4/MftOoVoWZ7PhRrBCHDbX06VMwL9hUfgF2VqFA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758720853309960.3094882916218; Wed, 24 Sep 2025 06:34:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v1Pch-00048s-CC; Wed, 24 Sep 2025 09:33:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v1Pcc-000488-Cy for qemu-devel@nongnu.org; Wed, 24 Sep 2025 09:33:26 -0400 Received: from forwardcorp1a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v1PcT-00047U-7b for qemu-devel@nongnu.org; Wed, 24 Sep 2025 09:33:23 -0400 Received: from mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1f:3a87:0:640:845c:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTPS id 870A8C102A; Wed, 24 Sep 2025 16:33:12 +0300 (MSK) Received: from vsementsov-lin.. (unknown [2a02:6bf:8080:b6c::1:2c]) by mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id AXYn2X0FqeA0-9O1ahz6j; Wed, 24 Sep 2025 16:33:11 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1758720791; bh=irCkse1XJDbrp3bOJle/wi2hzTP+EhpQQfGe4cGOV3s=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=kDZjWPQB9BPfMOijyS3ftH9iJFO5UozcSQA679o73D9xs8mwWp1AnnxISoQuMv7Qd mcDaOE7FPa13A4JR5BgbViU2SuIagz6e++PxDWHKWxZqu7AbAqgNy9zqPcmUbUrXRR Ds2+1lttUewCbSw508qvxtYu9EH8vOUMbbVfCytY= Authentication-Results: mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: armbru@redhat.com Cc: qemu-devel@nongnu.org, eblake@redhat.com, jasowang@redhat.com, devel@lists.libvirt.org, pbonzini@redhat.com, marcandre.lureau@redhat.com, yc-core@yandex-team.ru, vsementsov@yandex-team.ru, d-tatianin@yandex-team.ru Subject: [PATCH v2 1/2] chardev: remove deprecated 'reconnect' option Date: Wed, 24 Sep 2025 16:33:08 +0300 Message-ID: <20250924133309.334631-2-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250924133309.334631-1-vsementsov@yandex-team.ru> References: <20250924133309.334631-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c0e:500:1:45:d181:df01; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1a.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1758720858567116600 Content-Type: text/plain; charset="utf-8" It was deprecated in 9.2, time to remove. Note, that (which become obvious with this commit) we forget to do some checks for reconnect-ms options, for example, it was silently ignored for listening server, instead of error-out. The commit fixes this, as now we use reconnect_ms everywhere. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Daniil Tatianin --- chardev/char-socket.c | 24 +++++------------------- chardev/char.c | 3 --- docs/about/deprecated.rst | 6 ------ docs/about/removed-features.rst | 12 ++++++++++++ qapi/char.json | 14 +------------- 5 files changed, 18 insertions(+), 41 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index cb4ec78ebe..62852e3caf 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1296,9 +1296,9 @@ static bool qmp_chardev_validate_socket(ChardevSocket= *sock, /* Validate any options which have a dependency on address type */ switch (addr->type) { case SOCKET_ADDRESS_TYPE_FD: - if (sock->has_reconnect) { + if (sock->has_reconnect_ms) { error_setg(errp, - "'reconnect' option is incompatible with " + "'reconnect-ms' option is incompatible with " "'fd' address type"); return false; } @@ -1342,9 +1342,9 @@ static bool qmp_chardev_validate_socket(ChardevSocket= *sock, =20 /* Validate any options which have a dependency on client vs server */ if (!sock->has_server || sock->server) { - if (sock->has_reconnect) { + if (sock->has_reconnect_ms) { error_setg(errp, - "'reconnect' option is incompatible with " + "'reconnect-ms' option is incompatible with " "socket in server listen mode"); return false; } @@ -1361,12 +1361,6 @@ static bool qmp_chardev_validate_socket(ChardevSocke= t *sock, } } =20 - if (sock->has_reconnect_ms && sock->has_reconnect) { - error_setg(errp, - "'reconnect' and 'reconnect-ms' are mutually exclusive"); - return false; - } - return true; } =20 @@ -1384,7 +1378,7 @@ static void qmp_chardev_open_socket(Chardev *chr, bool is_tn3270 =3D sock->has_tn3270 ? sock->tn3270 : false; bool is_waitconnect =3D sock->has_wait ? sock->wait : false; bool is_websock =3D sock->has_websocket ? sock->websocket : false; - int64_t reconnect_ms =3D 0; + int64_t reconnect_ms =3D sock->has_reconnect_ms ? sock->reconnect_ms := 0; SocketAddress *addr; =20 s->is_listen =3D is_listen; @@ -1456,12 +1450,6 @@ static void qmp_chardev_open_socket(Chardev *chr, return; } } else { - if (sock->has_reconnect) { - reconnect_ms =3D sock->reconnect * 1000ULL; - } else if (sock->has_reconnect_ms) { - reconnect_ms =3D sock->reconnect_ms; - } - if (qmp_chardev_open_socket_client(chr, reconnect_ms, errp) < 0) { return; } @@ -1526,8 +1514,6 @@ static void qemu_chr_parse_socket(QemuOpts *opts, Cha= rdevBackend *backend, */ sock->has_wait =3D qemu_opt_find(opts, "wait") || sock->server; sock->wait =3D qemu_opt_get_bool(opts, "wait", true); - sock->has_reconnect =3D qemu_opt_find(opts, "reconnect"); - sock->reconnect =3D qemu_opt_get_number(opts, "reconnect", 0); sock->has_reconnect_ms =3D qemu_opt_find(opts, "reconnect-ms"); sock->reconnect_ms =3D qemu_opt_get_number(opts, "reconnect-ms", 0); =20 diff --git a/chardev/char.c b/chardev/char.c index bbebd246c3..a43b7e5481 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -892,9 +892,6 @@ QemuOptsList qemu_chardev_opts =3D { },{ .name =3D "nodelay", .type =3D QEMU_OPT_BOOL, - },{ - .name =3D "reconnect", - .type =3D QEMU_OPT_NUMBER, },{ .name =3D "reconnect-ms", .type =3D QEMU_OPT_NUMBER, diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index aa300bbd50..ba0be97513 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -438,12 +438,6 @@ Backend ``memory`` (since 9.0) =20 ``memory`` is a deprecated synonym for ``ringbuf``. =20 -``reconnect`` (since 9.2) -^^^^^^^^^^^^^^^^^^^^^^^^^ - -The ``reconnect`` option only allows specifying second granularity timeout= s, -which is not enough for all types of use cases, use ``reconnect-ms`` inste= ad. - =20 Net device options '''''''''''''''''' diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index a5338e44c2..d67928956a 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -1361,4 +1361,16 @@ The ``blacklist`` config file option has been rename= d to ``block-rpcs`` (to be in sync with the renaming of the corresponding command line option). =20 +Device options +-------------- + +Character device options +'''''''''''''''''''''''' + +``reconnect`` (removed in 10.2) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``reconnect`` has been replaced by ``reconnect-ms``, which provides +better precision. + .. _Intel discontinuance notification: https://www.intel.com/content/www/u= s/en/content-details/781327/intel-is-discontinuing-ip-ordering-codes-listed= -in-pdn2312-for-nios-ii-ip.html diff --git a/qapi/char.json b/qapi/char.json index f0a53f742c..b07e3bb827 100644 --- a/qapi/char.json +++ b/qapi/char.json @@ -269,22 +269,11 @@ # @websocket: enable websocket protocol on server sockets # (default: false) (Since: 3.1) # -# @reconnect: For a client socket, if a socket is disconnected, then -# attempt a reconnect after the given number of seconds. Setting -# this to zero disables this function. The use of this member is -# deprecated, use @reconnect-ms instead. (default: 0) (Since: 2.2) -# # @reconnect-ms: For a client socket, if a socket is disconnected, # then attempt a reconnect after the given number of milliseconds. -# Setting this to zero disables this function. This member is -# mutually exclusive with @reconnect. +# Setting this to zero disables this function. # (default: 0) (Since: 9.2) # -# Features: -# -# @deprecated: Member @reconnect is deprecated. Use @reconnect-ms -# instead. -# # Since: 1.4 ## { 'struct': 'ChardevSocket', @@ -297,7 +286,6 @@ '*telnet': 'bool', '*tn3270': 'bool', '*websocket': 'bool', - '*reconnect': { 'type': 'int', 'features': [ 'deprecated' ] }, '*reconnect-ms': 'int' }, 'base': 'ChardevCommon' } =20 --=20 2.48.1