From patchwork Fri Dec 9 06:54:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Evans X-Patchwork-Id: 130293 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 9465F1007D6 for ; Fri, 9 Dec 2011 17:53:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751881Ab1LIGx3 (ORCPT ); Fri, 9 Dec 2011 01:53:29 -0500 Received: from ozlabs.org ([203.10.76.45]:49460 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751682Ab1LIGx3 (ORCPT ); Fri, 9 Dec 2011 01:53:29 -0500 Received: from [10.61.2.183] (ibmaus65.lnk.telstra.net [165.228.126.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPSA id F083E1007D6; Fri, 9 Dec 2011 17:53:27 +1100 (EST) Message-ID: <4EE1B09C.7040902@ozlabs.org> Date: Fri, 09 Dec 2011 17:54:20 +1100 From: Matt Evans User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110921 Thunderbird/3.1.15 MIME-Version: 1.0 To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org CC: penberg@kernel.org, asias.hejun@gmail.com, levinsasha928@gmail.com, gorcunov@gmail.com Subject: [PATCH V2 10/23] kvm tools: Add CONSOLE_HV term type and allow it to be selected References: In-Reply-To: Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org This patch paves the way for adding a hypervisor console, useful on systems that support one out of the box yet don't have either serial port or virtio console support (e.g. kernels expecting POWER SPAPR). Signed-off-by: Matt Evans --- tools/kvm/builtin-run.c | 8 ++++++-- tools/kvm/include/kvm/term.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 68a3246..c067685 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@ -416,7 +416,7 @@ static const struct option options[] = { OPT_BOOLEAN('\0', "rng", &virtio_rng, "Enable virtio Random Number Generator"), OPT_CALLBACK('\0', "9p", NULL, "dir_to_share,tag_name", "Enable virtio 9p to share files between host and guest", virtio_9p_rootdir_parser), - OPT_STRING('\0', "console", &console, "serial or virtio", + OPT_STRING('\0', "console", &console, "serial, virtio or hv", "Console to use"), OPT_STRING('\0', "dev", &dev, "device_file", "KVM device file"), OPT_CALLBACK('\0', "tty", NULL, "tty id", @@ -776,8 +776,12 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix) if (!strncmp(console, "virtio", 6)) active_console = CONSOLE_VIRTIO; - else + else if (!strncmp(console, "serial", 6)) active_console = CONSOLE_8250; + else if (!strncmp(console, "hv", 2)) + active_console = CONSOLE_HV; + else + pr_warning("No console!"); if (!host_ip) host_ip = DEFAULT_HOST_ADDR; diff --git a/tools/kvm/include/kvm/term.h b/tools/kvm/include/kvm/term.h index 938c26f..a6a9822 100644 --- a/tools/kvm/include/kvm/term.h +++ b/tools/kvm/include/kvm/term.h @@ -6,6 +6,7 @@ #define CONSOLE_8250 1 #define CONSOLE_VIRTIO 2 +#define CONSOLE_HV 3 int term_putc_iov(int who, struct iovec *iov, int iovcnt, int term); int term_getc_iov(int who, struct iovec *iov, int iovcnt, int term);