[Bug 1079713] Re: [Qemu-devel] [PATCH 1.3] qapi: handle visitor->type_size() in QapiDeallocVisitor

Michael Roth 1079713 at bugs.launchpad.net
Mon Nov 26 15:44:20 UTC 2012


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 <stefanha at redhat.com>

Reviewed-by: Michael Roth <mdroth at linux.vnet.ibm.com>

> ---
> 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
> 
>

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to qemu-kvm in Ubuntu.
https://bugs.launchpad.net/bugs/1079713

Title:
  failed to set sndbuf on VMs network interface

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1079713/+subscriptions



More information about the Ubuntu-server-bugs mailing list