On 10/22/2012 10:08 PM, Eric Blake wrote:
On 10/21/2012 10:47 AM, Lei Li wrote:
Signed-off-by: Lei Li <li...@linux.vnet.ibm.com>
---
qemu-char.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 72 insertions(+), 0 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index b082bae..b174da1 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2588,6 +2588,78 @@ size_t qemu_chr_mem_osize(const CharDriverState *chr)
return d->outbuf_size;
}
+/*********************************************************/
+/*CircularMemoryr chardev*/
s/CircularMemoryr/CircularMemory/
Yeah, I just found it...
Thanks!
+static int cirmem_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
+{
+ CirMemCharDriver *d = chr->opaque;
+ int i;
+
+ if (len < 0) {
+ return -1;
+ }
+
+ /* The size should be a power of 2. */
Shouldn't you enforce that, then?
Yes, it has been checked when open the CirMemChar backend in patch 2/5,
as code below:
if (d->size & (d->size -1)) {
return NULL;
}
--
Lei