qapi: handle visitor->type_size() in QapiDeallocVisitor
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 26 Nov 2012 12:10:12 +0000 (13:10 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 26 Nov 2012 20:25:06 +0000 (14:25 -0600)
commit0c26f2eca40d6c65ea9edc62a10e510dc7f65cc8
tree51dd297ddb6ead5e1171380f8543abe68424a0a2
parente1e54f3fbee6c0652e19182f4c747de172cbe8b1
qapi: handle visitor->type_size() in QapiDeallocVisitor

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

Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi/qapi-dealloc-visitor.c