diff options
author | Mark McLoughlin <markmc@redhat.com> | 2009-10-27 18:16:37 +0000 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-11-09 08:43:02 -0600 |
commit | 839f368f2b3e4405c9847bf763bdaf3bc26f714d (patch) | |
tree | eb5a6cfed8a43ba83f35106437412585f412c391 /net | |
parent | 893379efd0e1b84ceb0c42a713293f3dbd27b1bd (diff) |
net/queue: queue packets even if sender doesn't supply a callback
Now that we disable any receiver whose queue is full, we do not require
senders to handle a zero return by supplying a sent callback.
This is a second step towards allowing can_receive() handlers to return
true even if no buffer space is available.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/queue.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/queue.c b/net/queue.c index e91a9a5d09..2ea6cd0b6a 100644 --- a/net/queue.c +++ b/net/queue.c @@ -186,7 +186,7 @@ ssize_t qemu_net_queue_send(NetQueue *queue, } ret = qemu_net_queue_deliver(queue, sender, flags, data, size); - if (ret == 0 && sent_cb != NULL) { + if (ret == 0) { qemu_net_queue_append(queue, sender, flags, data, size, sent_cb); return 0; } @@ -210,7 +210,7 @@ ssize_t qemu_net_queue_send_iov(NetQueue *queue, } ret = qemu_net_queue_deliver_iov(queue, sender, flags, iov, iovcnt); - if (ret == 0 && sent_cb != NULL) { + if (ret == 0) { qemu_net_queue_append_iov(queue, sender, flags, iov, iovcnt, sent_cb); return 0; } @@ -246,7 +246,7 @@ void qemu_net_queue_flush(NetQueue *queue) packet->flags, packet->data, packet->size); - if (ret == 0 && packet->sent_cb != NULL) { + if (ret == 0) { QTAILQ_INSERT_HEAD(&queue->packets, packet, entry); break; } |