aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-serial.h
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-04-27 18:03:59 +0530
committerAnthony Liguori <aliguori@us.ibm.com>2010-04-28 08:58:21 -0500
commit055b889f942b063bd1901a316b34017f2b699b12 (patch)
treebd783b69eba3e2b24c7963bc97bb11d891033406 /hw/virtio-serial.h
parent31abe21f4f026171128e6fbafb40062ae1872bd5 (diff)
downloadqemu-055b889f942b063bd1901a316b34017f2b699b12.zip
qemu-055b889f942b063bd1901a316b34017f2b699b12.tar.gz
qemu-055b889f942b063bd1901a316b34017f2b699b12.tar.bz2
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>
Diffstat (limited to 'hw/virtio-serial.h')
-rw-r--r--hw/virtio-serial.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/hw/virtio-serial.h b/hw/virtio-serial.h
index f297b00..0548689 100644
--- a/hw/virtio-serial.h
+++ b/hw/virtio-serial.h
@@ -27,6 +27,8 @@
/* Features supported */
#define VIRTIO_CONSOLE_F_MULTIPORT 1
+#define VIRTIO_CONSOLE_BAD_ID (~(uint32_t)0)
+
struct virtio_console_config {
/*
* These two fields are used by VIRTIO_CONSOLE_F_SIZE which
@@ -36,7 +38,6 @@ struct virtio_console_config {
uint16_t rows;
uint32_t max_nr_ports;
- uint32_t nr_ports;
} __attribute__((packed));
struct virtio_console_control {
@@ -46,12 +47,14 @@ struct virtio_console_control {
};
/* Some events for the internal messages (control packets) */
-#define VIRTIO_CONSOLE_PORT_READY 0
-#define VIRTIO_CONSOLE_CONSOLE_PORT 1
-#define VIRTIO_CONSOLE_RESIZE 2
-#define VIRTIO_CONSOLE_PORT_OPEN 3
-#define VIRTIO_CONSOLE_PORT_NAME 4
-#define VIRTIO_CONSOLE_PORT_REMOVE 5
+#define VIRTIO_CONSOLE_DEVICE_READY 0
+#define VIRTIO_CONSOLE_PORT_ADD 1
+#define VIRTIO_CONSOLE_PORT_REMOVE 2
+#define VIRTIO_CONSOLE_PORT_READY 3
+#define VIRTIO_CONSOLE_CONSOLE_PORT 4
+#define VIRTIO_CONSOLE_RESIZE 5
+#define VIRTIO_CONSOLE_PORT_OPEN 6
+#define VIRTIO_CONSOLE_PORT_NAME 7
/* == In-qemu interface == */