aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/virtio_console.h
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-05-19 22:15:48 -0600
committerRusty Russell <rusty@rustcorp.com.au>2010-05-19 22:15:49 +0930
commitf909f850d666e3dbac1ee7c9d5d83416bd02f84e (patch)
treea434032b27519ae0a92ab3a2d211fb240681f50c /include/linux/virtio_console.h
parentvirtio: console: Move code around for future patches (diff)
downloadlinux-dev-f909f850d666e3dbac1ee7c9d5d83416bd02f84e.tar.xz
linux-dev-f909f850d666e3dbac1ee7c9d5d83416bd02f84e.zip
virtio: console: Use a control message to add ports
Instead of the host and guest independently enumerating ports, switch to a control message to add ports where the host supplies the port number so there's no ambiguity or a possibility of a race between the host and the guest port numbers. We now no longer need the 'nr_ports' config value. Since no kernel has been released with the MULTIPORT changes yet, we have a chance to fiddle with the config space without adding compatibility features. This is beneficial for management software, which would now be able to instantiate ports at known locations and avoid problems that arise with implicit numbering in the host and the guest. This removes the 'guessing game' part of it, and management software can now actually indicate which id to spawn a particular port on. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/virtio_console.h')
-rw-r--r--include/linux/virtio_console.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h
index 015736113c25..a85064db8f94 100644
--- a/include/linux/virtio_console.h
+++ b/include/linux/virtio_console.h
@@ -23,8 +23,6 @@ struct virtio_console_config {
__u16 rows;
/* max. number of ports this device can hold */
__u32 max_nr_ports;
- /* number of ports added so far */
- __u32 nr_ports;
} __attribute__((packed));
/*
@@ -38,13 +36,14 @@ struct virtio_console_control {
};
/* Some events for control messages */
-#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 6
+#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
#ifdef __KERNEL__
int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int));