From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Td0rs-00046f-Ma for qemu-devel@nongnu.org; Mon, 26 Nov 2012 10:45:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Td0rn-00013L-Og for qemu-devel@nongnu.org; Mon, 26 Nov 2012 10:45:08 -0500 Received: from mail-oa0-f45.google.com ([209.85.219.45]:57038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Td0rn-00011j-KE for qemu-devel@nongnu.org; Mon, 26 Nov 2012 10:45:03 -0500 Received: by mail-oa0-f45.google.com with SMTP id i18so10370133oag.4 for ; Mon, 26 Nov 2012 07:45:03 -0800 (PST) Sender: fluxion Date: Mon, 26 Nov 2012 09:44:20 -0600 From: mdroth Message-ID: <20121126154419.GB8690@vm> References: <1353931812-4451-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1353931812-4451-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1.3] qapi: handle visitor->type_size() in QapiDeallocVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: 1079713@bugs.launchpad.net, Anthony Liguori , qemu-devel@nongnu.org On Mon, Nov 26, 2012 at 01:10:12PM +0100, Stefan Hajnoczi wrote: > visit_type_size() requires either visitor->type_size() or > visitor_uint64() to be implemented, otherwise a NULL function pointer is > invoked. > > It is possible to trigger this crash as follows: > > $ qemu-system-x86_64 -netdev tap,sndbuf=0,id=netdev0 \ > -device virtio-blk-pci,netdev=netdev0 > > The 'sndbuf' option has type "size". > > Signed-off-by: Stefan Hajnoczi Reviewed-by: Michael Roth > --- > This patch ensures that -netdev tap,sndbuf=X works in QEMU 1.3. > > qapi/qapi-dealloc-visitor.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c > index a154523..a07b171 100644 > --- a/qapi/qapi-dealloc-visitor.c > +++ b/qapi/qapi-dealloc-visitor.c > @@ -132,6 +132,11 @@ static void qapi_dealloc_type_number(Visitor *v, double *obj, const char *name, > { > } > > +static void qapi_dealloc_type_size(Visitor *v, size_t *obj, const char *name, > + Error **errp) > +{ > +} > + > static void qapi_dealloc_type_enum(Visitor *v, int *obj, const char *strings[], > const char *kind, const char *name, > Error **errp) > @@ -164,6 +169,7 @@ QapiDeallocVisitor *qapi_dealloc_visitor_new(void) > v->visitor.type_bool = qapi_dealloc_type_bool; > v->visitor.type_str = qapi_dealloc_type_str; > v->visitor.type_number = qapi_dealloc_type_number; > + v->visitor.type_size = qapi_dealloc_type_size; > > QTAILQ_INIT(&v->stack); > > -- > 1.8.0 > >