diff options
author | Amit Shah <amit.shah@redhat.com> | 2010-05-20 00:15:48 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-05-19 08:45:49 -0400 |
commit | f909f850d666e3dbac1ee7c9d5d83416bd02f84e (patch) | |
tree | a434032b27519ae0a92ab3a2d211fb240681f50c /include/linux/virtio_console.h | |
parent | c446f8fcc9fba3369bffb894b31756cf7a09f783 (diff) |
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.h | 17 |
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 { | |||
23 | __u16 rows; | 23 | __u16 rows; |
24 | /* max. number of ports this device can hold */ | 24 | /* max. number of ports this device can hold */ |
25 | __u32 max_nr_ports; | 25 | __u32 max_nr_ports; |
26 | /* number of ports added so far */ | ||
27 | __u32 nr_ports; | ||
28 | } __attribute__((packed)); | 26 | } __attribute__((packed)); |
29 | 27 | ||
30 | /* | 28 | /* |
@@ -38,13 +36,14 @@ struct virtio_console_control { | |||
38 | }; | 36 | }; |
39 | 37 | ||
40 | /* Some events for control messages */ | 38 | /* Some events for control messages */ |
41 | #define VIRTIO_CONSOLE_PORT_READY 0 | 39 | #define VIRTIO_CONSOLE_DEVICE_READY 0 |
42 | #define VIRTIO_CONSOLE_CONSOLE_PORT 1 | 40 | #define VIRTIO_CONSOLE_PORT_ADD 1 |
43 | #define VIRTIO_CONSOLE_RESIZE 2 | 41 | #define VIRTIO_CONSOLE_PORT_REMOVE 2 |
44 | #define VIRTIO_CONSOLE_PORT_OPEN 3 | 42 | #define VIRTIO_CONSOLE_PORT_READY 3 |
45 | #define VIRTIO_CONSOLE_PORT_NAME 4 | 43 | #define VIRTIO_CONSOLE_CONSOLE_PORT 4 |
46 | #define VIRTIO_CONSOLE_PORT_REMOVE 5 | 44 | #define VIRTIO_CONSOLE_RESIZE 5 |
47 | #define VIRTIO_CONSOLE_DEVICE_READY 6 | 45 | #define VIRTIO_CONSOLE_PORT_OPEN 6 |
46 | #define VIRTIO_CONSOLE_PORT_NAME 7 | ||
48 | 47 | ||
49 | #ifdef __KERNEL__ | 48 | #ifdef __KERNEL__ |
50 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); | 49 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); |