diff options
author | Amit Shah <amit.shah@redhat.com> | 2010-01-20 00:36:54 +0530 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-01-20 08:25:23 -0600 |
commit | 160600fd137a3a6f0d6a09579cf2282152f842ab (patch) | |
tree | b5cb507027f5ec5c17a6f9df9bcdc231f555b87f /hw/virtio-serial.h | |
parent | 6663a1956eb628f1bddc96d2cab361e039df5571 (diff) |
virtio-serial-bus: Add a port 'name' property for port discovery in guests
The port 'id' or number is internal state between the guest kernel and
our bus implementation. This is invocation-dependent and isn't part of
the guest-host ABI.
To correcly enumerate and map ports between the host and the guest, the
'name' property is used.
Example:
-device virtserialport,name=org.qemu.port.0
This invocation will get us a char device in the guest at:
/dev/virtio-ports/org.qemu.port.0
which can be a symlink to
/dev/vport0p3
This 'name' property is exposed by the guest kernel in a sysfs
attribute:
/sys/kernel/virtio-ports/vport0p3/name
A simple udev script can pick up this name and create the symlink
mentioned above.
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.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/virtio-serial.h b/hw/virtio-serial.h index d9c7acba3d..28ea7da8b7 100644 --- a/hw/virtio-serial.h +++ b/hw/virtio-serial.h @@ -50,6 +50,7 @@ struct virtio_console_control { #define VIRTIO_CONSOLE_CONSOLE_PORT 1 #define VIRTIO_CONSOLE_RESIZE 2 #define VIRTIO_CONSOLE_PORT_OPEN 3 +#define VIRTIO_CONSOLE_PORT_NAME 4 /* == In-qemu interface == */ @@ -84,6 +85,13 @@ struct VirtIOSerialPort { VirtQueue *ivq, *ovq; /* + * This name is sent to the guest and exported via sysfs. + * The guest could create symlinks based on this information. + * The name is in the reverse fqdn format, like org.qemu.console.0 + */ + char *name; + + /* * This id helps identify ports between the guest and the host. * The guest sends a "header" with this id with each data packet * that it sends and the host can then find out which associated |