kvm tools: Add CONSOLE_HV term type and allow it to be selected

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 <matt@ozlabs.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
Matt Evans
2011-12-09 17:54:20 +11:00
committed by Will Deacon
parent 8e704a7a0b
commit 3bbc49b616
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -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;
+1
View File
@@ -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);