diff options
author | Markus Armbruster <armbru@redhat.com> | 2011-05-25 14:21:11 +0200 |
---|---|---|
committer | Amit Shah <amit.shah@redhat.com> | 2011-05-27 15:50:56 +0530 |
commit | 2a3d57ce4278dfd898d8b5639ace21fa4a4fb9bd (patch) | |
tree | 0e3871d8821936e28b246af06477910dea74be25 /hw/virtio-console.c | |
parent | 5e52e5f903b2648c59030637e1610b32e965d615 (diff) | |
download | qemu-2a3d57ce4278dfd898d8b5639ace21fa4a4fb9bd.tar.gz qemu-2a3d57ce4278dfd898d8b5639ace21fa4a4fb9bd.tar.bz2 qemu-2a3d57ce4278dfd898d8b5639ace21fa4a4fb9bd.zip |
virtio-serial: Clean up virtconsole detection
virtio-serial-bus needs to treat "virtconsole" devices specially. It
uses VirtIOSerialPort member is_console to recognize them. It gets
its value via property initialization. Cute hack, except it lets
users mess with it: "-device virtconsole,is_console=0" isn't plugged
into port 0 as it should.
Move the flag to VirtIOSerialPortInfo. Keep the property for backward
compatibility; its value has no effect.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Diffstat (limited to 'hw/virtio-console.c')
-rw-r--r-- | hw/virtio-console.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/virtio-console.c b/hw/virtio-console.c index de539c4eac..50b85f8a60 100644 --- a/hw/virtio-console.c +++ b/hw/virtio-console.c @@ -91,7 +91,7 @@ static int virtconsole_initfn(VirtIOSerialPort *port) { VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port); - port->is_console = true; + port->is_console_dummy = true; return generic_port_init(vcon, port); } @@ -113,10 +113,11 @@ static int virtconsole_exitfn(VirtIOSerialPort *port) static VirtIOSerialPortInfo virtconsole_info = { .qdev.name = "virtconsole", .qdev.size = sizeof(VirtConsole), + .is_console = true, .init = virtconsole_initfn, .exit = virtconsole_exitfn, .qdev.props = (Property[]) { - DEFINE_PROP_UINT8("is_console", VirtConsole, port.is_console, 1), + DEFINE_PROP_UINT8("is_console", VirtConsole, port.is_console_dummy, 1), DEFINE_PROP_UINT32("nr", VirtConsole, port.id, VIRTIO_CONSOLE_BAD_ID), DEFINE_PROP_CHR("chardev", VirtConsole, chr), DEFINE_PROP_STRING("name", VirtConsole, port.name), |