Revision 2a3d57ce
b/hw/virtio-console.c | ||
---|---|---|
91 | 91 |
{ |
92 | 92 |
VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port); |
93 | 93 |
|
94 |
port->is_console = true; |
|
94 |
port->is_console_dummy = true;
|
|
95 | 95 |
return generic_port_init(vcon, port); |
96 | 96 |
} |
97 | 97 |
|
... | ... | |
113 | 113 |
static VirtIOSerialPortInfo virtconsole_info = { |
114 | 114 |
.qdev.name = "virtconsole", |
115 | 115 |
.qdev.size = sizeof(VirtConsole), |
116 |
.is_console = true, |
|
116 | 117 |
.init = virtconsole_initfn, |
117 | 118 |
.exit = virtconsole_exitfn, |
118 | 119 |
.qdev.props = (Property[]) { |
119 |
DEFINE_PROP_UINT8("is_console", VirtConsole, port.is_console, 1), |
|
120 |
DEFINE_PROP_UINT8("is_console", VirtConsole, port.is_console_dummy, 1),
|
|
120 | 121 |
DEFINE_PROP_UINT32("nr", VirtConsole, port.id, VIRTIO_CONSOLE_BAD_ID), |
121 | 122 |
DEFINE_PROP_CHR("chardev", VirtConsole, chr), |
122 | 123 |
DEFINE_PROP_STRING("name", VirtConsole, port.name), |
b/hw/virtio-serial-bus.c | ||
---|---|---|
356 | 356 |
* this port is a console port so that the guest can hook it |
357 | 357 |
* up to hvc. |
358 | 358 |
*/ |
359 |
if (port->is_console) { |
|
359 |
if (port->info->is_console) {
|
|
360 | 360 |
send_control_event(port, VIRTIO_CONSOLE_CONSOLE_PORT, 1); |
361 | 361 |
} |
362 | 362 |
|
... | ... | |
729 | 729 |
* location 0. This is done for backward compatibility (old |
730 | 730 |
* kernel, new qemu). |
731 | 731 |
*/ |
732 |
plugging_port0 = port->is_console && !find_port_by_id(port->vser, 0);
|
|
732 |
plugging_port0 = info->is_console && !find_port_by_id(port->vser, 0);
|
|
733 | 733 |
|
734 | 734 |
if (find_port_by_id(port->vser, port->id)) { |
735 | 735 |
error_report("virtio-serial-bus: A port already exists at id %u\n", |
b/hw/virtio-serial.h | ||
---|---|---|
124 | 124 |
*/ |
125 | 125 |
QEMUBH *bh; |
126 | 126 |
|
127 |
/* Identify if this is a port that binds with hvc in the guest */
|
|
128 |
uint8_t is_console; |
|
127 |
/* For property backward compatibility, not used otherwise */
|
|
128 |
uint8_t is_console_dummy;
|
|
129 | 129 |
|
130 | 130 |
/* Is the corresponding guest device open? */ |
131 | 131 |
bool guest_connected; |
... | ... | |
137 | 137 |
|
138 | 138 |
struct VirtIOSerialPortInfo { |
139 | 139 |
DeviceInfo qdev; |
140 |
|
|
141 |
/* Is this a device that binds with hvc in the guest? */ |
|
142 |
bool is_console; |
|
143 |
|
|
140 | 144 |
/* |
141 | 145 |
* The per-port (or per-app) init function that's called when a |
142 | 146 |
* new device is found on the bus. |
Also available in: Unified diff