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 <email address hidden>
On Mon, Nov 26, 2012 at 01:10:12PM +0100, Stefan Hajnoczi wrote: >type_size( ) or 0,id=netdev0 \ blk-pci, netdev= netdev0
> visit_type_size() requires either visitor-
> 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=
> -device virtio-
>
> The 'sndbuf' option has type "size".
>
> Signed-off-by: Stefan Hajnoczi <email address hidden>
Reviewed-by: Michael Roth <email address hidden>
> --- dealloc- visitor. c | 6 ++++++ qapi-dealloc- visitor. c b/qapi/ qapi-dealloc- visitor. c qapi-dealloc- visitor. c qapi-dealloc- visitor. c type_number( Visitor *v, double *obj, const char *name, type_size( Visitor *v, size_t *obj, const char *name, type_enum( Visitor *v, int *obj, const char *strings[], visitor_ new(void) type_bool = qapi_dealloc_ type_bool; type_str; type_number = qapi_dealloc_ type_number; type_size = qapi_dealloc_ type_size; INIT(&v- >stack) ;
> This patch ensures that -netdev tap,sndbuf=X works in QEMU 1.3.
>
> qapi/qapi-
> 1 file changed, 6 insertions(+)
>
> diff --git a/qapi/
> index a154523..a07b171 100644
> --- a/qapi/
> +++ b/qapi/
> @@ -132,6 +132,11 @@ static void qapi_dealloc_
> {
> }
>
> +static void qapi_dealloc_
> + Error **errp)
> +{
> +}
> +
> static void qapi_dealloc_
> const char *kind, const char *name,
> Error **errp)
> @@ -164,6 +169,7 @@ QapiDeallocVisitor *qapi_dealloc_
> v->visitor.
> v->visitor.type_str = qapi_dealloc_
> v->visitor.
> + v->visitor.
>
> QTAILQ_
>
> --
> 1.8.0
>
>