summaryrefslogtreecommitdiffstats
path: root/vl.c
diff options
context:
space:
mode:
authorAmit Shah2010-01-21 11:49:23 +0100
committerAnthony Liguori2010-01-26 22:42:02 +0100
commit392ecf543dd2b219828374850d833296a55567ea (patch)
treeeff64de427f0a1d7dada7650eaeb829075eaf620 /vl.c
parentvirtio-console: Rename virtio-serial.c back to virtio-console.c (diff)
downloadqemu-392ecf543dd2b219828374850d833296a55567ea.tar.gz
qemu-392ecf543dd2b219828374850d833296a55567ea.tar.xz
qemu-392ecf543dd2b219828374850d833296a55567ea.zip
virtio-console: Automatically use virtio-serial-bus for the older -virtioconsole invocation
These hunks got dropped off mysteriously during the rebasing of my virtio-serial series. Thanks go to Markus for noticing it. Without these fixes, -virtioconsole doesn't actually have any effect. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index 2fb5b581f4..5e8c775089 100644
--- a/vl.c
+++ b/vl.c
@@ -288,8 +288,9 @@ static struct {
{ .driver = "isa-parallel", .flag = &default_parallel },
{ .driver = "isa-fdc", .flag = &default_floppy },
{ .driver = "ide-drive", .flag = &default_cdrom },
- { .driver = "virtio-console-pci", .flag = &default_virtcon },
- { .driver = "virtio-console-s390", .flag = &default_virtcon },
+ { .driver = "virtio-serial-pci", .flag = &default_virtcon },
+ { .driver = "virtio-serial-s390", .flag = &default_virtcon },
+ { .driver = "virtio-serial", .flag = &default_virtcon },
{ .driver = "VGA", .flag = &default_vga },
{ .driver = "cirrus-vga", .flag = &default_vga },
{ .driver = "vmware-svga", .flag = &default_vga },
@@ -4629,6 +4630,7 @@ static int virtcon_parse(const char *devname)
{
static int index = 0;
char label[32];
+ QemuOpts *bus_opts, *dev_opts;
if (strcmp(devname, "none") == 0)
return 0;
@@ -4636,6 +4638,13 @@ static int virtcon_parse(const char *devname)
fprintf(stderr, "qemu: too many virtio consoles\n");
exit(1);
}
+
+ bus_opts = qemu_opts_create(&qemu_device_opts, NULL, 0);
+ qemu_opt_set(bus_opts, "driver", "virtio-serial");
+
+ dev_opts = qemu_opts_create(&qemu_device_opts, NULL, 0);
+ qemu_opt_set(dev_opts, "driver", "virtconsole");
+
snprintf(label, sizeof(label), "virtcon%d", index);
virtcon_hds[index] = qemu_chr_open(label, devname, NULL);
if (!virtcon_hds[index]) {
@@ -4643,6 +4652,8 @@ static int virtcon_parse(const char *devname)
devname, strerror(errno));
return -1;
}
+ qemu_opt_set(dev_opts, "chardev", label);
+
index++;
return 0;
}