From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Td6XB-0004xM-C7 for qemu-devel@nongnu.org; Mon, 26 Nov 2012 16:48:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Td6XA-0003ZA-4d for qemu-devel@nongnu.org; Mon, 26 Nov 2012 16:48:09 -0500 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:37423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Td6X9-0003Yh-GZ for qemu-devel@nongnu.org; Mon, 26 Nov 2012 16:48:08 -0500 Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Nov 2012 03:18:04 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qAQLm2K54587790 for ; Tue, 27 Nov 2012 03:18:02 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qAR3HqsZ029978 for ; Tue, 27 Nov 2012 14:17:53 +1100 From: Anthony Liguori In-Reply-To: <1353931812-4451-1-git-send-email-stefanha@redhat.com> References: <1353931812-4451-1-git-send-email-stefanha@redhat.com> Date: Mon, 26 Nov 2012 15:47:55 -0600 Message-ID: <87y5horq7o.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 , qemu-devel@nongnu.org Cc: 1079713@bugs.launchpad.net, Michael Roth Stefan Hajnoczi writes: > 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 > --- > This patch ensures that -netdev tap,sndbuf=X works in QEMU 1.3. > Applied. Thanks. Regards, Anthony Liguori > 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