virtio-net: split the has_buffers() logic from can_receive()
authorMark McLoughlin <markmc@redhat.com>
Tue, 27 Oct 2009 18:16:38 +0000 (18:16 +0000)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 9 Nov 2009 14:43:02 +0000 (08:43 -0600)
commit0ccdefb928978f74863675327866f3b743f8114a
tree6f1b669c8dcc886571eb1130f1a75f345300da5d
parent2c170c774d02c035595b7c1e7ae2abc50214af26
virtio-net: split the has_buffers() logic from can_receive()

We should only return zero from receive() for a condition which we'll
get notification of when it changes. Currently, we're returning zero
if the guest driver is not ready, but we won't ever flush our queue
when that status changes.

Also, don't check buffer space in can_receive(), but instead just allow
receive() to return zero when this condition occurs and have the caller
handle queueing the packet.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/virtio-net.c