virtio-serial-bus: Add a port 'name' property for port discovery in guests
commit160600fd137a3a6f0d6a09579cf2282152f842ab
authorAmit Shah <amit.shah@redhat.com>
Tue, 19 Jan 2010 19:06:54 +0000 (20 00:36 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 20 Jan 2010 14:25:23 +0000 (20 08:25 -0600)
treeb5cb507027f5ec5c17a6f9df9bcdc231f555b87f
parent6663a1956eb628f1bddc96d2cab361e039df5571
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>
hw/virtio-serial-bus.c
hw/virtio-serial.c
hw/virtio-serial.h