qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 06/12] char: add an edge event API for the front


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 06/12] char: add an edge event API for the front ends
Date: Mon, 01 Aug 2011 10:40:34 -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:39 AM, Stefan Hajnoczi wrote:
On Mon, Aug 1, 2011 at 3:23 PM, Anthony Liguori<address@hidden>  wrote:
Signed-off-by: Anthony Liguori<address@hidden>
---
  qemu-char.c |   91 +++++++++++++++++++++++++++++++++++++++++++++++++----------
  qemu-char.h |    9 ++++++
  2 files changed, 85 insertions(+), 15 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 0e4a30c..9e40e04 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -139,13 +139,23 @@ void qemu_chr_generic_open(CharDriverState *s)
     }
  }

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

bool function naming nitpick: char_queue_is_empty() is clearer than
char_queue_get_empty().  "is" and "has" are always bool, "get" could
return anything.

Ack.

I thought the same thing to myself, meant to rename it, and then promptly forgot to :-)

Regards,

Anthony Liguori


Stefan





reply via email to

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