virtio-serial: Discard data that guest sends us when ports aren't connected
commita69c76008597ccdffae7a933686ab856ca85e87c
authorAmit Shah <amit.shah@redhat.com>
Tue, 27 Apr 2010 12:34:10 +0000 (27 18:04 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 28 Apr 2010 13:58:22 +0000 (28 08:58 -0500)
tree9bcdd27cc164eb4cff9a5d01eaaa97081dd7b6f8
parent1e4476aa03b70e78b0dbc21cebd6e9f9c6835067
virtio-serial: Discard data that guest sends us when ports aren't connected

Before the earlier patch, we relied on incorrect virtio api usage to
signal to the guest that a particular buffer wasn't consumed by the
host.

After fixing that, we now just discard the data the guest sends us while
a host port is disconnected or doesn't have a handler registered for
consuming data.

This commit really doesn't change anything from the current behaviour,
just makes the code slightly better by spinning off data handling to
ports in another function.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/virtio-serial-bus.c