From patchwork Fri Apr 8 15:17:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ingo Molnar X-Patchwork-Id: 694891 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 p38FHX9D007939 for ; Fri, 8 Apr 2011 15:17:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932156Ab1DHPRa (ORCPT ); Fri, 8 Apr 2011 11:17:30 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:59902 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932136Ab1DHPRa (ORCPT ); Fri, 8 Apr 2011 11:17:30 -0400 Received: from elvis.elte.hu ([157.181.1.14]) by mx2.mail.elte.hu with esmtp (Exim) id 1Q8DR5-00055u-CZ from ; Fri, 08 Apr 2011 17:17:29 +0200 Received: by elvis.elte.hu (Postfix, from userid 1004) id 057853E250F; Fri, 8 Apr 2011 17:17:18 +0200 (CEST) Date: Fri, 8 Apr 2011 17:17:20 +0200 From: Ingo Molnar To: Pekka Enberg Cc: KVM devel mailing list Subject: [PATCH] kvm tools: Indicate the end of a KVM session Message-ID: <20110408151720.GA15259@elte.hu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) Received-SPF: neutral (mx2.mail.elte.hu: 157.181.1.14 is neither permitted nor denied by domain of elte.hu) client-ip=157.181.1.14; envelope-from=mingo@elte.hu; helo=elvis.elte.hu; X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.3.1 -2.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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]); Fri, 08 Apr 2011 15:17:34 +0000 (UTC) Right now when a KVM session ends with an incomplete line printk'd without a newline, kvm exits in an ugly way: [ 4.638016] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 4.641668] Rebooting in 1 seconds..spirit:~/tip/tools/kvm> spirit:~/tip/tools/kvm> See the shell prompt intermixed with the last line of kernel output. There's also no indication to the user that everything is fine on the kvm tool side. This is somewhat of a beauty wart and also a bit confusing to users. To clarify and clean up things, add a final printout on normal exits: [ 4.654814] Please append a correct "root=" boot option; here are the available partitions: [ 4.584390] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 4.662243] Rebooting in 1 seconds.. # KVM session ended normally. spirit:~/tip/tools/kvm> This delimits the kernel output properly and gives feedback to the user that (despite the scary kernel messages) all fine from the KVM POV. Signed-off-by: Ingo Molnar --- tools/kvm/main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" 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/main.c b/tools/kvm/main.c index d8f0c09..bc16502 100644 --- a/tools/kvm/main.c +++ b/tools/kvm/main.c @@ -201,6 +201,8 @@ exit_kvm: disk_image__close(kvm->disk_image); kvm__delete(kvm); + printf("\n # KVM session ended normally.\n"); + return 0; panic_kvm: