]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Introduce --enable-virtio-console option
authorAsias He <asias.hejun@gmail.com>
Fri, 8 Apr 2011 14:12:53 +0000 (22:12 +0800)
committerPekka Enberg <penberg@kernel.org>
Fri, 8 Apr 2011 11:53:25 +0000 (14:53 +0300)
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 <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/main.c

index 90906d29307a1630731aa507f8733fda998f7eb7..5bcefde3e96e1aa8f6454ca15934e6f74ac7bece 100644 (file)
 #include <stdio.h>
 
 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=<device>] [--mem=<size-in-MiB>] [--params=<kernel-params>] "
                "[--initrd=<initrd>] [--kernel=]<kernel-image> [--image=]<disk-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)