From nobody Mon May 6 16:59:38 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555524789; cv=none; d=zoho.com; s=zohoarc; b=dPMW7tn0JT3gULfNuwq4izBXRVw/QZX6mr9ra11zJt1DpyiF9FIj0haR9xrAhaQnpiPzTvF4uFh6v1wZJyr6Ei2zn1Hws8CkxbFMCCllAWAbMRlVhtzMR4Pa2HEQm8kU6Jf92hOQLsC5SVRAxBtuSJPDJuBJKJWnPuR6L7I6jDI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555524789; h=Content-Type:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=3OUxxAgjUU0QOCOAx9EpyaMNLG2FaWN2C8u3DcULgk4=; b=YMynDYFuoGmdh/v2KHMIgbOVXr+huVMkApdx8Rqwfv8LheBRR3ap0LmhE7lzIJGlN4/mReOLJQwYbERwXMe2TllL0/zv4SoEouvJR+ZXFrGrlkqfXdCh89TJmKLjtSpT+hioNb7MPY3LsOYo+IDet0xtk93+5YvJPvaT0DwubGo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1555524789616997.4942232464813; Wed, 17 Apr 2019 11:13:09 -0700 (PDT) Received: from localhost ([127.0.0.1]:57629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGp3H-0004ek-5q for importer@patchew.org; Wed, 17 Apr 2019 14:12:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGp2R-0004LL-4z for qemu-devel@nongnu.org; Wed, 17 Apr 2019 14:12:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGp2Q-0005oZ-6t for qemu-devel@nongnu.org; Wed, 17 Apr 2019 14:12:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23804) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hGp2P-0005oC-Us for qemu-devel@nongnu.org; Wed, 17 Apr 2019 14:12:02 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 25396301988C for ; Wed, 17 Apr 2019 18:12:01 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E655A1001E8A for ; Wed, 17 Apr 2019 18:12:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 654D21138648; Wed, 17 Apr 2019 20:11:59 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org References: <20190411145256.8614-1-armbru@redhat.com> Date: Wed, 17 Apr 2019 20:11:59 +0200 In-Reply-To: <20190411145256.8614-1-armbru@redhat.com> (Markus Armbruster's message of "Thu, 11 Apr 2019 16:52:41 +0200") Message-ID: <87mukov6vk.fsf@dusky.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 17 Apr 2019 18:12:01 +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 v2 14.5/15] char-pty: Print "char device redirected" message to stdout 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" char_pty_open() prints a "char device redirected to PTY_NAME (label LABEL)" message to the current monitor or else to stderr. This is not an error, so it shouldn't go to stderr. Print it to stdout instead. Why is it even printed? No other ChardevClass::open() prints anything on success. It's because you need to know PTY_NAME to actually use this char device, e.g. like e.g. "socat STDIO,cfmakeraw FILE:PTY_NAME" to use the monitor's readline interface. You can get PTY_NAME with "info chardev" (a.k.a. query-chardev for QMP), but only if you already have a monitor. Signed-off-by: Markus Armbruster --- chardev/char-pty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chardev/char-pty.c b/chardev/char-pty.c index b034332edd..4ff2f328fa 100644 --- a/chardev/char-pty.c +++ b/chardev/char-pty.c @@ -211,8 +211,8 @@ static void char_pty_open(Chardev *chr, qemu_set_nonblock(master_fd); =20 chr->filename =3D g_strdup_printf("pty:%s", pty_name); - error_printf("char device redirected to %s (label %s)\n", - pty_name, chr->label); + qemu_printf("char device redirected to %s (label %s)\n", + pty_name, chr->label); =20 s =3D PTY_CHARDEV(chr); s->ioc =3D QIO_CHANNEL(qio_channel_file_new_fd(master_fd)); --=20 2.17.2