From nobody Sun Apr 28 07:50:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658824369; cv=none; d=zohomail.com; s=zohoarc; b=agyDc8XsDaJ2PGDsbO/UzWo1YaFeu+dRJEXBBacU0Gt6K5DLR2ZaXYxJYKdLolZEK+ySTqe++QWflFuUeduKxxDP+HF17AMDHeINRBpIyrtAlu3N9vxb+R3VmIl6FxP0KEInv9scs9cEGfASzuypBEDVauJKpdhbCRgtcoDOmEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658824369; 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=n4eivMtWrcKtn3zlTBzXFhyfAvql9/EXE0UQLhkoOqmp3ZrXaLJo40gKJvLgfWBEmHv1QiYuokXEnlj2V6u457iTAVXdQSCijAZ0ycQJ1PCmKEookOqM11HzcTPKj6IneJNm0p+uK/YiFSh0m9/ngDfYlez5P9nCRViEWkwIVBc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1658824369494886.1281811555008; Tue, 26 Jul 2022 01:32:49 -0700 (PDT) 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-531-rpzPKnR1Pv2x0yKS4PyCyw-1; Tue, 26 Jul 2022 04:32:45 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CC0521019C8F; Tue, 26 Jul 2022 08:32:42 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EFA390A11; Tue, 26 Jul 2022 08:32:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1C7AB1945D89; Tue, 26 Jul 2022 08:32:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A95B91945D86 for ; Tue, 26 Jul 2022 08:32:38 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 968571121319; 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=1658824368; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fNZGipaB6QysJYdVBjCh950CTICNWnOeL8ceIb+BPFI=; b=CXzRT/0nZ7L9mdTOQnGaZEw+hnZwpDi1GzgM9cVKF13zmxE5oBNXtIi/DfFHgLUy2x6cbg 0EVIpqqJgKhkcN/Ar7LQNYTS90zm/IoRN17rpQMq6ULCkAMWB9M1qKzX8V5FSnh4lCxBvy kv64EUaoHZjGpejjapc3P1FS6H+/xEg= X-MC-Unique: rpzPKnR1Pv2x0yKS4PyCyw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org 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 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "reviewer:Incompatible changes" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , kraxel@redhat.com, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658824370475100001 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