From nobody Sat Apr 27 01:53:18 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658824507; cv=none; d=zohomail.com; s=zohoarc; b=jsnQWXswZXdHp9EjY7E8BZpB9ipd/+i+ljlXWPY7srJxlTEhJgesg0S5pVcpqL8rMi428I+4ZZxfQWjs5GQgZ2nsocqTOQeq85gQHK1kRAw3weBPNH6BuV0u0nvZCVd/ZVCKv/hTR5Usvb+2VvkCZqiCcWTTGky4+WLEEk47k0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658824507; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=fNZGipaB6QysJYdVBjCh950CTICNWnOeL8ceIb+BPFI=; b=KE76hfmvfC8DdjnhMqqvkEeiKM3DxDZYTK/A9g6WoSOvWSkM4dC1shyRMeTio0/8AcL4I/36/XIxSBmzC26xSqh6mY2UERx87dv2crd4msHYluy3fjvHgfLzVJEh7im2NMs6kIygR+zowq2f64bBssqrbMcI37bI8p3x0J+dExY= 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+importer2=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 1658824507684297.4303698516819; Tue, 26 Jul 2022 01:35:07 -0700 (PDT) Received: from localhost ([::1]:58256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGG1y-00032U-Ge for importer2@patchew.org; Tue, 26 Jul 2022 04:35:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGFzh-0002L5-Pq for qemu-devel@nongnu.org; Tue, 26 Jul 2022 04:32:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGFze-0006NY-Lu for qemu-devel@nongnu.org; Tue, 26 Jul 2022 04:32:44 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-386-QQ6Yy3sLM1KGsE7OSxVOCg-1; Tue, 26 Jul 2022 04:32:38 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 971E085A585 for ; Tue, 26 Jul 2022 08:32:38 +0000 (UTC) Received: from localhost (unknown [10.39.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACBB91121314; Tue, 26 Jul 2022 08:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658824361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fNZGipaB6QysJYdVBjCh950CTICNWnOeL8ceIb+BPFI=; b=ceTcGcqEjn4biRebntYWtZR0gIE5Xk23ZSiNxQjrC3qkrvEMH9VIaYWCNJzcUH5FOrmYZD W2qR3LNwjFstFl0Lpv/DVYuB4BnzhY6w8pqMHt6+b3n+1lXxwdYL3AqM+o+yE/eAp29HdU 0UZYiBxkTikKBrP3vAYWKBLLXEssE5c= X-MC-Unique: QQ6Yy3sLM1KGsE7OSxVOCg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , libvir-list@redhat.com (reviewer:Incompatible changes) Subject: [PATCH] RFC: char: deprecate usage of bidirectional pipe Date: Tue, 26 Jul 2022 12:32:32 +0400 Message-Id: <20220726083232.2567756-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658824508108100001 From: Marc-Andr=C3=A9 Lureau As Ed Swierk explained back in 2006: https://lists.nongnu.org/archive/html/qemu-devel/2006-12/msg00160.html "When qemu writes into the pipe, it immediately reads back what it just wrote and treats it as a monitor command, endlessly breathing its own exhaust." This is similarly confusing when using the chardev with a serial device, as reported in https://bugzilla.redhat.com/show_bug.cgi?id=3D2106975. It seems we have kept the support for bidirectional pipes for historical reasons and odd systems, however it's not documented in qemu -chardev options. I suggest to stop supporting it, for portability reasons. Signed-off-by: Marc-Andr=C3=A9 Lureau --- docs/about/deprecated.rst | 6 ++++++ chardev/char-pipe.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 7ee26626d5cf..dd5ca30d527b 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -45,6 +45,12 @@ transmit audio through the VNC protocol. ``tty`` and ``parport`` are aliases that will be removed. Instead, the actual backend names ``serial`` and ``parallel`` should be used. =20 +``-chardev pipe`` support for bidirectional pipes (since 7.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +For portability reasons, the support for bidirectional ``pipe`` will +be removed. Instead, use ``file.in`` & ``file.out`` unidirectional pipes. + Short-form boolean options (since 6.0) '''''''''''''''''''''''''''''''''''''' =20 diff --git a/chardev/char-pipe.c b/chardev/char-pipe.c index 66d3b8509183..7db963035e7d 100644 --- a/chardev/char-pipe.c +++ b/chardev/char-pipe.c @@ -27,6 +27,7 @@ #include "qemu/main-loop.h" #include "qemu/module.h" #include "qemu/option.h" +#include "qemu/error-report.h" #include "chardev/char.h" =20 #ifdef _WIN32 @@ -142,6 +143,9 @@ static void qemu_chr_open_pipe(Chardev *chr, if (fd_out >=3D 0) { close(fd_out); } + warn_report("Support for bidirectional pipe is deprecated,"); + warn_report("please use portable one-way pipes instead (%s.in & %s= .out).", + filename, filename); TFR(fd_in =3D fd_out =3D qemu_open_old(filename, O_RDWR | O_BINARY= )); if (fd_in < 0) { error_setg_file_open(errp, errno, filename); --=20 2.37.0.rc0