From patchwork Fri Apr 8 14:12:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 692581 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p37EEXHl001812 for ; Thu, 7 Apr 2011 14:14:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752849Ab1DGOOa (ORCPT ); Thu, 7 Apr 2011 10:14:30 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:40472 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752339Ab1DGOOa (ORCPT ); Thu, 7 Apr 2011 10:14:30 -0400 Received: by mail-iy0-f174.google.com with SMTP id 14so2503015iyb.19 for ; Thu, 07 Apr 2011 07:14:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=HRpUXcjkkX728gbCKtLK4PF2ASnYfkHl0rvAmWFF/zM=; b=k2dZEKTabNQohP3nWu5IwQqBOOoV32ARZnJKUJO9ySScKxz/BZUT06CRZF/cauw/vM hD1jaxycKctL3DEu0vipbFpB9aqW4/FKmRN57v2XpD8lQgYudtKQpQG0iX2UZ6noRpnw G0cELnVwnLo3bB/GsybxKeyXvVn2x75kx1hbg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=LTbLY9pcEIBe1zSF1q46QtiwBKitheL2Ym/sfiS/RD9K4ilCJFMvOInMEZcBxtYy3K CAeCb29QPlD8iqQFE5AN+PFkoLZS5JegSjapxdFLi8YjuVJDa4gPR4DYYu9Kx2g62FpB uw+uhTrIZedRRdpCihWQPBYtXYS0aFwJcThr4= Received: by 10.43.62.210 with SMTP id xb18mr1529325icb.349.1302185669794; Thu, 07 Apr 2011 07:14:29 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id m10sm2277615wfl.11.2011.04.07.07.14.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 07 Apr 2011 07:14:29 -0700 (PDT) From: Asias He To: Pekka Enberg , Cyrill Gorcunov Cc: kvm@vger.kernel.org, Ingo Molnar , Asias He Subject: [PATCH 6/6] kvm tools: introduce --enable-virtio-console option Date: Fri, 8 Apr 2011 22:12:53 +0800 Message-Id: <1302271973-7604-6-git-send-email-asias.hejun@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1302271973-7604-1-git-send-email-asias.hejun@gmail.com> References: <1302271973-7604-1-git-send-email-asias.hejun@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 07 Apr 2011 14:14:35 +0000 (UTC) This option enables virtio console and disables serial console. At this time, the virtio and serial console can not work simultaneously. Becasue we can not put both console's output to user at the same time. However, once we redirect the virtio console to a pipe or socket. We can use both console simultaneously. Signed-off-by: Asias He --- tools/kvm/main.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/tools/kvm/main.c b/tools/kvm/main.c index 90906d2..5bcefde 100644 --- a/tools/kvm/main.c +++ b/tools/kvm/main.c @@ -17,11 +17,12 @@ #include extern bool ioport_debug; +extern int active_console; static void usage(char *argv[]) { fprintf(stderr, " usage: %s " - "[--single-step] [--ioport-debug] " + "[--single-step] [--ioport-debug] [--enable-virtio-console] " "[--kvm-dev=] [--mem=] [--params=] " "[--initrd=] [--kernel=] [--image=]\n", argv[0]); @@ -85,6 +86,9 @@ int main(int argc, char *argv[]) } else if (option_matches(argv[i], "--single-step")) { single_step = true; continue; + } else if (option_matches(argv[i], "--enable-virtio-console")) { + active_console = CONSOLE_VIRTIO; + continue; } else if (option_matches(argv[i], "--mem=")) { unsigned long val = atol(&argv[i][6]) << 20; if (val < ram_size)