mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
virtio-serial: Use control messages to notify guest of new ports
Allow the port 'id's to be set by a user on the command line. This is needed by management apps that will want a stable port numbering scheme for hot-plug/unplug and migration. Since the port numbers are shared with the guest (to identify ports in control messages), we just send a control message to the guest indicating addition of new ports (hot-plug) or notifying the guest of the available ports when the guest sends us a DEVICE_READY control message. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
31abe21f4f
commit
055b889f94
3 changed files with 135 additions and 72 deletions
|
@ -99,6 +99,7 @@ static VirtIOSerialPortInfo virtconsole_info = {
|
|||
.exit = virtconsole_exitfn,
|
||||
.qdev.props = (Property[]) {
|
||||
DEFINE_PROP_UINT8("is_console", VirtConsole, port.is_console, 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),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
|
@ -133,6 +134,7 @@ static VirtIOSerialPortInfo virtserialport_info = {
|
|||
.init = virtserialport_initfn,
|
||||
.exit = virtconsole_exitfn,
|
||||
.qdev.props = (Property[]) {
|
||||
DEFINE_PROP_UINT32("nr", VirtConsole, port.id, VIRTIO_CONSOLE_BAD_ID),
|
||||
DEFINE_PROP_CHR("chardev", VirtConsole, chr),
|
||||
DEFINE_PROP_STRING("name", VirtConsole, port.name),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue