[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 33/43] qapi: handle visitor->type_size() in QapiDea
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 33/43] qapi: handle visitor->type_size() in QapiDeallocVisitor |
Date: |
Mon, 3 Dec 2012 16:44:30 -0600 |
From: Stefan Hajnoczi <address@hidden>
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 <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>
(cherry picked from commit 0c26f2eca40d6c65ea9edc62a10e510dc7f65cc8)
Signed-off-by: Michael Roth <address@hidden>
---
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.7.9.5
- [Qemu-stable] [PATCH 23/43] tcg/arm: fix cross-endian qemu_st16, (continued)
- [Qemu-stable] [PATCH 23/43] tcg/arm: fix cross-endian qemu_st16, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 25/43] configure: avoid compiler warning in pipe2 detection, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 22/43] tcg/arm: fix TLB access in qemu-ld/st ops, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 24/43] target-openrisc: remove conflicting definitions from cpu.h, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 28/43] block: Fix regression for MinGW (assertion caused by short string), Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 34/43] qapi: fix qapi_dealloc_type_size parameter type, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 33/43] qapi: handle visitor->type_size() in QapiDeallocVisitor,
Michael Roth <=
- [Qemu-stable] [PATCH 35/43] iscsi: fix segfault in url parsing, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 36/43] iscsi: fix deadlock during login, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 37/43] iscsi: do not assume device is zero initialized, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 38/43] virtio-scsi: Fix some endian bugs with virtio-scsi, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 39/43] virtio-scsi: Fix subtle (guest) endian bug, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 40/43] qxl: reload memslots after migration, when qxl is in UNDEFINED mode, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 41/43] usb: fail usbdevice_create() when there is no USB bus, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 42/43] stream: fix ratelimit_set_speed, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 43/43] e1000: Discard packets that are too long if !SBP and !LPE, Michael Roth, 2012/12/03
- [Qemu-stable] [PATCH 27/43] tci: Fix type of tci_read_label, Michael Roth, 2012/12/03