qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 5/9] qapi_sized_buffer


From: Joel Schopp
Subject: [Qemu-devel] [PATCH 5/9] qapi_sized_buffer
Date: Tue, 12 Mar 2013 22:09:38 -0500

Add a sized buffer interface to qapi.

Cc: Michael Tsirkin <address@hidden>
Signed-off-by: Stefan Berger <address@hidden>
Signed-off-by: Joel Schopp <address@hidden>
---
 include/qapi/visitor-impl.h |    2 ++
 include/qapi/visitor.h      |    2 ++
 qapi/qapi-visit-core.c      |    8 ++++++++
 3 files changed, 12 insertions(+)

diff --git a/include/qapi/visitor-impl.h b/include/qapi/visitor-impl.h
index 79fe039..cf743f6 100644
--- a/include/qapi/visitor-impl.h
+++ b/include/qapi/visitor-impl.h
@@ -38,6 +38,8 @@ struct Visitor
                         size_t elem_count, size_t elem_size, Error **errp);
     void (*next_carray)(Visitor *v, Error **errp);
     void (*end_carray)(Visitor *v, Error **errp);
+    void (*type_sized_buffer)(Visitor *v, uint8_t **obj, size_t size,
+                              const char *name, Error **errp);
 
     /* May be NULL */
     void (*start_optional)(Visitor *v, bool *present, const char *name,
diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h
index 49f411f..8a8c4e9 100644
--- a/include/qapi/visitor.h
+++ b/include/qapi/visitor.h
@@ -55,5 +55,7 @@ void visit_start_carray(Visitor *v, void **obj, const char 
*name,
                        size_t elem_count, size_t elem_size, Error **errp);
 void visit_next_carray(Visitor *v, Error **errp);
 void visit_end_carray(Visitor *v, Error **errp);
+void visit_type_sized_buffer(Visitor *v, uint8_t **obj, size_t len,
+                             const char *name, Error **errp);
 
 #endif
diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
index d9982f8..4b36a54 100644
--- a/qapi/qapi-visit-core.c
+++ b/qapi/qapi-visit-core.c
@@ -338,3 +338,11 @@ void visit_end_carray(Visitor *v, Error **errp)
         v->end_carray(v, errp);
     }
 }
+
+void visit_type_sized_buffer(Visitor *v, uint8_t **obj, size_t len,
+                             const char *name, Error **errp)
+{
+    if (!error_is_set(errp)) {
+        v->type_sized_buffer(v, obj, len, name, errp);
+    }
+}
-- 
1.7.10.4




reply via email to

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