From patchwork Mon Aug 7 08:53:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 9884775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8C7CC60364 for ; Mon, 7 Aug 2017 08:56:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 804CC285D1 for ; Mon, 7 Aug 2017 08:56:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75555285DC; Mon, 7 Aug 2017 08:56:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E8B8F285D1 for ; Mon, 7 Aug 2017 08:56:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dedoA-0005Sm-2S; Mon, 07 Aug 2017 08:54:42 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dedo8-0005Qi-SU for xen-devel@lists.xenproject.org; Mon, 07 Aug 2017 08:54:40 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id 63/2B-03406-0DA28895; Mon, 07 Aug 2017 08:54:40 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRWlGSWpSXmKPExsXiVRtsqHteqyP S4OtrZYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNaNx1mr2gsuiFeeWbmBvYJwt2MXIySEkMJNR 4uFV/S5GLg4WgXnMEk9e9DCBOBIC/awSk1+3AjkcQE6axJbtSiANEgLVEi3PJzFDNGtJHD01m xWkXkigjUli3+4ZYPVsAiYSszokQGpEBJQk7q2aDDaTWWA+o0TTpF42kISwQIzEzeuNjCA2i4 CqxLa+32A2r4CPxO31+9kglslJ3DzXCbaMEyh+/tIbFojF3hK3j/UxTmAUWMDIsIpRvTi1qCy 1SNdEL6koMz2jJDcxM0fX0MBMLze1uDgxPTUnMalYLzk/dxMjMKwYgGAHY/dl/0OMkhxMSqK8 8SvaIoX4kvJTKjMSizPii0pzUosPMcpwcChJ8CZodkQKCRalpqdWpGXmAAMcJi3BwaMkwvtCH SjNW1yQmFucmQ6ROsVozDHpwPYvTByvJvz/xiTEkpeflyolznsOZJIASGlGaR7cIFjkXWKUlR LmZQQ6TYinILUoN7MEVf4VozgHo5IwbxjIFJ7MvBK4fa+ATmECOuVNYivIKSWJCCmpBsbIPvN FK0/ds21quqD5e/k179Nr2b9OnjCDq+m0glt/AtukfwYnxFP5rI8ccq4PXvLp1NLsv8s9rDod np3bvlI+5pJPybIcx2YvX6PsqJW7rFe/MFh26W3i1XkzHf03LNQ+Mv/p9zfHC7dcduuMPtJtc ycny/xR88vd3Y+X3zxwPTOtqLVPJG+GEktxRqKhFnNRcSIA/01g5bcCAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-16.tower-27.messagelabs.com!1502096078!110307531!1 X-Originating-IP: [74.125.83.49] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4982 invoked from network); 7 Aug 2017 08:54:39 -0000 Received: from mail-pg0-f49.google.com (HELO mail-pg0-f49.google.com) (74.125.83.49) by server-16.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 7 Aug 2017 08:54:39 -0000 Received: by mail-pg0-f49.google.com with SMTP id y129so31673896pgy.4 for ; Mon, 07 Aug 2017 01:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HWroLNIkhQjYUcAWyd7ghBserWIB9IYYwUwfhZwGLVc=; b=kGgfdwsE9sqNvN/buQoPv1v1h81W6ainbfNSL9O5djLbY0ZlVDcO9UHCal/XwAK3va 20hOVCzYdcm7xlur/gY+ljP4hKREjt89zJurR/DgM4pdYgWNXUiHi8vsA+eUgNx77nMs Dg/8/XyCRgeWYEQ4DAoYUd469XQCivQRiaZsI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HWroLNIkhQjYUcAWyd7ghBserWIB9IYYwUwfhZwGLVc=; b=ssG7Iiw7RECgv5QPMbRZOltt7gy6oERHjhPVvdGG8OK6mcZG2iAmLwKisa4rSBn80b gKfkckPeTCxe8FcaR86rtSFuFd6T4XPNZ0avw170KVehqd0Y6uArt+J4/y7UoHtNlAwp 6y45VhnBj9sw9Zj8nKkALy8vk5n56l2zdEu6uYlUTsS3Z6nEdu9dIuQhWrX8UFxEgYYX um6sebb/ZMfyL+gh3WLQ6k7S8fl5LdFVUHNfapBKIkrhptkMfR/Ybt6ykIoXt5rwyysb P3BhQl5BVxyJopLvetk6zqQ8OESmDlxxAXovHzw4DrCbd9G31dn+iQuBJ7LVgPr8ZzRL qo4w== X-Gm-Message-State: AIVw1138Ii+vy9cyaVmeuGOXiLmF+c6r1glLCT2ly42Q3o9wGAb6T6GX JR/Q4rmjD5IxMcyMLMWH/w== X-Received: by 10.99.97.129 with SMTP id v123mr10651258pgb.337.1502096077823; Mon, 07 Aug 2017 01:54:37 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id p77sm12604047pfi.153.2017.08.07.01.54.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 01:54:37 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 7 Aug 2017 14:23:15 +0530 Message-Id: <1502095997-31219-24-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> References: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 23/25 v7] xen/arm: vpl011: Add a new vuart console type to xenconsole client X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add a new console type VUART to connect to guest's emualated vuart console. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini Acked-by: Wei Liu --- CC: Ian Jackson CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall Changes since v4: - Removed the vuart compile time flag so that vuart code is compiled always. Changes since v3: - The vuart console support is under CONFIG_VUART_CONSOLE option. - Since there is a change from last review, I have not included reviewed-by tag from Stefano and acked-by tag from Wei. tools/console/client/main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/console/client/main.c b/tools/console/client/main.c index c340cb7..f92ad3d 100644 --- a/tools/console/client/main.c +++ b/tools/console/client/main.c @@ -76,7 +76,7 @@ static void usage(const char *program) { "\n" " -h, --help display this help and exit\n" " -n, --num N use console number N\n" - " --type TYPE console type. must be 'pv' or 'serial'\n" + " --type TYPE console type. must be 'pv', 'serial' or 'vuart'\n" " --start-notify-fd N file descriptor used to notify parent\n" , program); } @@ -264,6 +264,7 @@ typedef enum { CONSOLE_INVAL, CONSOLE_PV, CONSOLE_SERIAL, + CONSOLE_VUART, } console_type; static struct termios stdin_old_attr; @@ -344,6 +345,7 @@ int main(int argc, char **argv) char *end; console_type type = CONSOLE_INVAL; bool interactive = 0; + char *console_names = "serial, pv, vuart"; while((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) { switch(ch) { @@ -359,9 +361,12 @@ int main(int argc, char **argv) type = CONSOLE_SERIAL; else if (!strcmp(optarg, "pv")) type = CONSOLE_PV; + else if (!strcmp(optarg, "vuart")) + type = CONSOLE_VUART; else { fprintf(stderr, "Invalid type argument\n"); - fprintf(stderr, "Console types supported are: serial, pv\n"); + fprintf(stderr, "Console types supported are: %s\n", + console_names); exit(EINVAL); } break; @@ -437,6 +442,10 @@ int main(int argc, char **argv) else snprintf(path, strlen(dom_path) + strlen("/device/console/%d/tty") + 5, "%s/device/console/%d/tty", dom_path, num); } + if (type == CONSOLE_VUART) { + snprintf(path, strlen(dom_path) + strlen("/vuart/0/tty") + 1, + "%s/vuart/0/tty", dom_path); + } /* FIXME consoled currently does not assume domain-0 doesn't have a console which is good when we break domain-0 up. To keep us