提交 392ecf54 编写于 作者: A Amit Shah 提交者: Anthony Liguori

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: NAmit Shah <amit.shah@redhat.com>
Reported-by: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 4c36a2ff
Subproject commit 5da68339ecf44677b8f4f115cdf3cb1da46a9f6c
Subproject commit 8362699269d7b3c816981be0e306d7531aa3ea1d
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册