]> git.proxmox.com Git - mirror_qemu.git/commit - hw/net/virtio-net.c
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)
commitcdd5cc12ba8cf0c068da319370bdd3ba45eaf7ac
tree6f1b669c8dcc886571eb1130f1a75f345300da5d
parent839f368f2b3e4405c9847bf763bdaf3bc26f714d
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