summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-15 20:05:25 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-15 20:05:25 +0000
commit9ede2fde19eaf65c07c8bed3936e78dc0ed37412 (patch)
treeab0803974c9804d73e060673c4293fe456fac842 /vl.c
parentc76ee25de48ab27a89fc6886256def0900ba7b60 (diff)
downloadqemu-9ede2fde19eaf65c07c8bed3936e78dc0ed37412.tar.gz
qemu-9ede2fde19eaf65c07c8bed3936e78dc0ed37412.tar.bz2
qemu-9ede2fde19eaf65c07c8bed3936e78dc0ed37412.zip
add virtio-console support (Christian Ehrhardt)
This patch adds the virtio console to qemu. This console can be found after the serial and parallel outputs as another virtual console. In the -nographic case it is redirected to the null output by default. Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6315 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index e29072b5f9..2379986877 100644
--- a/vl.c
+++ b/vl.c
@@ -209,6 +209,7 @@ static int no_frame = 0;
int no_quit = 0;
CharDriverState *serial_hds[MAX_SERIAL_PORTS];
CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
+CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES];
#ifdef TARGET_I386
int win2k_install_hack = 0;
#endif
@@ -4502,6 +4503,8 @@ int main(int argc, char **argv, char **envp)
int serial_device_index;
const char *parallel_devices[MAX_PARALLEL_PORTS];
int parallel_device_index;
+ const char *virtio_consoles[MAX_VIRTIO_CONSOLES];
+ int virtio_console_index;
const char *loadvm = NULL;
QEMUMachine *machine;
const char *cpu_model;
@@ -4575,6 +4578,11 @@ int main(int argc, char **argv, char **envp)
parallel_devices[i] = NULL;
parallel_device_index = 0;
+ virtio_consoles[0] = "vc:80Cx24C";
+ for(i = 1; i < MAX_VIRTIO_CONSOLES; i++)
+ virtio_consoles[i] = NULL;
+ virtio_console_index = 0;
+
usb_devices_index = 0;
nb_net_clients = 0;
@@ -5170,6 +5178,8 @@ int main(int argc, char **argv, char **envp)
parallel_devices[0] = "null";
if (strncmp(monitor_device, "vc", 2) == 0)
monitor_device = "stdio";
+ if (virtio_console_index == 0)
+ virtio_consoles[0] = "null";
}
#ifndef _WIN32
@@ -5464,6 +5474,22 @@ int main(int argc, char **argv, char **envp)
}
}
+ for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) {
+ const char *devname = virtio_consoles[i];
+ if (devname && strcmp(devname, "none")) {
+ char label[32];
+ snprintf(label, sizeof(label), "virtcon%d", i);
+ virtcon_hds[i] = qemu_chr_open(label, devname);
+ if (!virtcon_hds[i]) {
+ fprintf(stderr, "qemu: could not open virtio console '%s'\n",
+ devname);
+ exit(1);
+ }
+ if (strstart(devname, "vc", 0))
+ qemu_chr_printf(virtcon_hds[i], "virtio console%d\r\n", i);
+ }
+ }
+
if (kvm_enabled()) {
int ret;