summaryrefslogtreecommitdiff
path: root/hw/virtio-serial.h
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.h
parent5e52e5f903b2648c59030637e1610b32e965d615 (diff)
downloadqemu-2a3d57ce4278dfd898d8b5639ace21fa4a4fb9bd.tar.gz
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.h')
-rw-r--r--hw/virtio-serial.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/virtio-serial.h b/hw/virtio-serial.h
index b783ee26ce..350ed21911 100644
--- a/hw/virtio-serial.h
+++ b/hw/virtio-serial.h
@@ -124,8 +124,8 @@ struct VirtIOSerialPort {
*/
QEMUBH *bh;
- /* Identify if this is a port that binds with hvc in the guest */
- uint8_t is_console;
+ /* For property backward compatibility, not used otherwise */
+ uint8_t is_console_dummy;
/* Is the corresponding guest device open? */
bool guest_connected;
@@ -137,6 +137,10 @@ struct VirtIOSerialPort {
struct VirtIOSerialPortInfo {
DeviceInfo qdev;
+
+ /* Is this a device that binds with hvc in the guest? */
+ bool is_console;
+
/*
* The per-port (or per-app) init function that's called when a
* new device is found on the bus.