From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: Joel Schopp <jschopp@linux.vnet.ibm.com>,
Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, Michael Tsirkin <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/9] qapi_c_arrays.diff
Date: Wed, 13 Mar 2013 18:54:29 -0400 [thread overview]
Message-ID: <514103A5.9070803@linux.vnet.ibm.com> (raw)
In-Reply-To: <1363200988-17865-3-git-send-email-jschopp@linux.vnet.ibm.com>
On 03/13/2013 02:56 PM, Joel Schopp wrote:
> Forward ported Mike's previously sent patch
> (see http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg05782.html ) in my
> series since it implements a qapi array interface the ASN.1 BER visitor needs.
>
> Generally these will be serialized into lists, but the
> representation can be of any form so long as it can
> be deserialized into a single-dimension C array.
>
> Cc: Michael Tsirkin <mst@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> Signed-off-by: Joel Schopp <jschopp@linux.vnet.ibm.com>
> ---
> include/qapi/visitor-impl.h | 4 ++++
> include/qapi/visitor.h | 4 ++++
> qapi/qapi-visit-core.c | 25 +++++++++++++++++++++++++
> 3 files changed, 33 insertions(+)
>
> +++ b/include/qapi/visitor.h
> @@ -51,5 +51,9 @@ void visit_type_size(Visitor *v, uint64_t *obj, const char *name, Error **errp);
> void visit_type_bool(Visitor *v, bool *obj, const char *name, Error **errp);
> void visit_type_str(Visitor *v, char **obj, const char *name, Error **errp);
> void visit_type_number(Visitor *v, double *obj, const char *name, Error **errp);
> +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);
>
> #endif
> diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
> index 401ee6e..d9982f8 100644
> --- a/qapi/qapi-visit-core.c
> +++ b/qapi/qapi-visit-core.c
> @@ -313,3 +313,28 @@ void input_type_enum(Visitor *v, int *obj, const char *strings[],
> g_free(enum_str);
> *obj = value;
> }
> +
> +void visit_start_carray(Visitor *v, void **obj, const char *name,
> + size_t elem_count, size_t elem_size, Error **errp)
> +{
> + g_assert(v->start_carray);
> + if (!error_is_set(errp)) {
> + v->start_carray(v, obj, name, elem_count, elem_size, errp);
> + }
So this is a c-like array with a given number of elements and each
element having to have the same size? As long as all use cases for QEMU
can live with this, I guess it's fine, though an array of sized buffers,
each with different size, may be more 'general'.
How many other callers are there so that we can talk about disparities
between visitors as mentioned in the comment in 5/9? At least we would
have immediate callers for the sized buffer interface.
http://lists.gnu.org/archive/html/qemu-devel/2013-03/msg02254.html
Regards,
Stefan
next prev parent reply other threads:[~2013-03-13 22:54 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-13 18:56 [Qemu-devel] [PATCH 0/9 v3] Implement and test asn1 ber visitors Joel Schopp
2013-03-13 18:56 ` [Qemu-devel] [PATCH 1/9] qemu-file Joel Schopp
2013-03-13 18:56 ` [Qemu-devel] [PATCH 2/9] qapi_c_arrays.diff Joel Schopp
2013-03-13 19:11 ` Anthony Liguori
2013-03-13 22:54 ` Stefan Berger [this message]
2013-03-13 18:56 ` [Qemu-devel] [PATCH 3/9] two new file wrappers Joel Schopp
2013-03-13 21:04 ` Eric Blake
2013-03-14 10:49 ` Stefan Berger
2013-03-13 18:56 ` [Qemu-devel] [PATCH 4/9] qemu_qsb.diff Joel Schopp
2013-03-13 21:11 ` mdroth
2013-03-13 21:28 ` Stefan Berger
2013-03-13 22:41 ` mdroth
2013-03-13 22:47 ` mdroth
2013-03-13 23:11 ` Stefan Berger
2013-03-13 18:56 ` [Qemu-devel] [PATCH 5/9] qapi_sized_buffer Joel Schopp
2013-03-13 20:52 ` mdroth
2013-03-13 22:00 ` Stefan Berger
2013-03-13 23:18 ` mdroth
2013-03-14 1:48 ` Stefan Berger
2013-03-14 12:18 ` mdroth
2013-03-14 13:39 ` Stefan Berger
2013-03-14 14:28 ` mdroth
2013-03-14 14:51 ` Stefan Berger
2013-03-14 15:11 ` mdroth
2013-03-14 15:24 ` Stefan Berger
2013-03-14 21:06 ` mdroth
2013-03-15 2:05 ` Stefan Berger
2013-03-13 18:56 ` [Qemu-devel] [PATCH 6/9] asn1_output-visitor.diff Joel Schopp
2013-03-13 18:56 ` [Qemu-devel] [PATCH 7/9] asn1_input-visitor.diff Joel Schopp
2013-03-13 18:56 ` [Qemu-devel] [PATCH 8/9] asn1_test_visitor_serialization.diff Joel Schopp
2013-03-13 18:56 ` [Qemu-devel] [PATCH 9/9] update_maintainers.diff Joel Schopp
-- strict thread matches above, loose matches on Subject: below --
2013-03-13 3:09 [Qemu-devel] [PATCH 0/9 v2] Implement and test asn1 ber visitors Joel Schopp
2013-03-13 3:09 ` [Qemu-devel] [PATCH 2/9] qapi_c_arrays.diff Joel Schopp
2013-03-13 12:08 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=514103A5.9070803@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=jschopp@linux.vnet.ibm.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).