diff mbox

kvm tools: Indicate the end of a KVM session

Message ID 20110408151720.GA15259@elte.hu (mailing list archive)
State New, archived
Headers show

Commit Message

Ingo Molnar April 8, 2011, 3:17 p.m. 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 <mingo@elte.hu>
---
 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

Comments

Pekka Enberg April 8, 2011, 3:25 p.m. UTC | #1
On Fri, 8 Apr 2011, Ingo Molnar wrote:
> Right now when a KVM session ends with an incomplete line printk'd
> without a newline, kvm exits in an ugly way:

Applied, thanks!
--
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 mbox

Patch

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: