qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 04/12] char: introduce backend tx queue


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 04/12] char: introduce backend tx queue
Date: Mon, 01 Aug 2011 10:37:11 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 08/01/2011 10:33 AM, Stefan Hajnoczi wrote:
On Mon, Aug 1, 2011 at 3:23 PM, Anthony Liguori<address@hidden>  wrote:
While the front tx queue has no flow control, the backend tx queue uses a
polling function to determine when the front end can receive data.

To convert this to the new queue model, we simply try to flush the backend tx
queue whenever we poll.  We then return the remaining space in the queue as
the value of the polling function.

Signed-off-by: Anthony Liguori<address@hidden>
---
  qemu-char.c |   49 ++++++++++++++++++++++++++++++++++++++++---------
  qemu-char.h |    3 ++-
  2 files changed, 42 insertions(+), 10 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 3f9b32c..2746652 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -173,6 +173,11 @@ static size_t char_queue_read(CharQueue *q, void *data, 
size_t size)
     return i;
  }

+static uint32_t char_queue_get_avail(CharQueue *q)
+{
+    return sizeof(q->ring) - (q->prod - q->cons);
+}

"avail" confuses me.  How many bytes are available for the consumer?
How many bytes are available for the producer?

How about char_queue_get_space() or char_queue_get_nfree()?

Sure.

Regards,

Anthony Liguori


Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]