summary refs log tree commit diff stats
path: root/hw/virtio-serial-bus.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2011-05-25 14:21:11 +0200
committerAmit Shah <amit.shah@redhat.com>2011-05-27 15:50:56 +0530
commit2a3d57ce4278dfd898d8b5639ace21fa4a4fb9bd (patch)
tree0e3871d8821936e28b246af06477910dea74be25 /hw/virtio-serial-bus.c
parent5e52e5f903b2648c59030637e1610b32e965d615 (diff)
downloadfocaccia-qemu-2a3d57ce4278dfd898d8b5639ace21fa4a4fb9bd.tar.gz
focaccia-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-serial-bus.c')
-rw-r--r--hw/virtio-serial-bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 812f481f47..ed44fab11c 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -356,7 +356,7 @@ static void handle_control_message(VirtIOSerial *vser, void *buf, size_t len)
          * this port is a console port so that the guest can hook it
          * up to hvc.
          */
-        if (port->is_console) {
+        if (port->info->is_console) {
             send_control_event(port, VIRTIO_CONSOLE_CONSOLE_PORT, 1);
         }
 
@@ -729,7 +729,7 @@ static int virtser_port_qdev_init(DeviceState *qdev, DeviceInfo *base)
      * location 0. This is done for backward compatibility (old
      * kernel, new qemu).
      */
-    plugging_port0 = port->is_console && !find_port_by_id(port->vser, 0);
+    plugging_port0 = info->is_console && !find_port_by_id(port->vser, 0);
 
     if (find_port_by_id(port->vser, port->id)) {
         error_report("virtio-serial-bus: A port already exists at id %u\n",