From patchwork Fri Apr 6 08:47:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 895637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40HYGq6lzHz9s1p for ; Fri, 6 Apr 2018 18:47:15 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40HYGq5VBYzF20f for ; Fri, 6 Apr 2018 18:47:15 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=redhat.com (client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lvivier@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40HYGl19FdzF1ym for ; Fri, 6 Apr 2018 18:47:10 +1000 (AEST) 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 mx1.redhat.com (Postfix) with ESMTPS id 6F39E7C6DC; Fri, 6 Apr 2018 08:47:07 +0000 (UTC) Received: from thinkpad.redhat.com (unknown [10.40.205.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 964081227724; Fri, 6 Apr 2018 08:47:05 +0000 (UTC) From: Laurent Vivier To: slof@lists.ozlabs.org Date: Fri, 6 Apr 2018 10:47:02 +0200 Message-Id: <20180406084704.29048-1-lvivier@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 06 Apr 2018 08:47:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 06 Apr 2018 08:47:07 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lvivier@redhat.com' RCPT:'' Subject: [SLOF] [PATCH v6 0/2] Fix output word X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" This patch fixes the output word, and allow to select the console. It updates input word in the same way. For the moment it works well while we don't mix serial port console with VGA console or virtio-console (there is a special case for VGA console that overwrite without condition the emit word, see 9b89b28 "Add support for qemu standard VGA". Im' working on this). You can test it with: qemu-system-ppc64 -nodefaults -nographic \ -chardev socket,id=serial_id_serial0,host=localhost,port=4441,telnet,server,wait \ -device spapr-vty,chardev=serial_id_serial0 \ -chardev socket,id=serial_id_serial1,host=localhost,port=4442,telnet,server,wait \ -device spapr-vty,chardev=serial_id_serial1 \ -monitor stdio Connect on the two ports with "telnet localhost 4441" and "telnet 4442". Once it is done you will see on the first console the SLOF logs. Then, in the first console: " /vdevice/vty@71000002" input Now what you write on second console is written on the first one. To send the characters to the second one, we should use: " /vdevice/vty@71000002" output but it doesn't work and this patch fixes that. A shortcut for these two commands is: " /vdevice/vty@71000002" io v6: - don't change indentation for readability - don't change error case handling, let "[ ' key behavior compile, ]" and use "[ ' emit behavior compile, ]" as I don't know how to manage this correctly. It could be fixed by a future patch. v5: - close previous ihandle in set-stdin and set-stdout v4: - use variables to store stdin and stdout ihandle (rename them) - introduce set-stdin and set-stdout - update error message v3: - code cleanup and re-order - store ihandle and xt handle for input too v2: - resolve ihandle and xt handle in the output command to speed up emit function milliseconds 2000 0 do 41 emit loop milliseconds swap - cr .d cr original: 770 v1: 4710 v2: 1721 Laurent Vivier (2): Fix output word resolve ihandle and xt handle in the input command (like for the output) slof/fs/term-io.fs | 71 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 18 deletions(-)