[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/16] qapi: make visit_type_size fallback to type_i
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 04/16] qapi: make visit_type_size fallback to type_int |
Date: |
Tue, 23 Jul 2013 18:23:00 +0200 |
From: Vasilis Liaskovitis <address@hidden>
Currently visit_type_size checks if the visitor's type_size function pointer is
NULL. If not, it calls it, otherwise it calls v->type_uint64(). But neither of
these pointers are ever set. Fallback to calling v->type_int() in this third
(default) case.
Signed-off-by: Vasilis Liaskovitis <address@hidden>
Signed-off-by: Hu Tao <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
---
qapi/qapi-visit-core.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
index 401ee6e..fcacaff 100644
--- a/qapi/qapi-visit-core.c
+++ b/qapi/qapi-visit-core.c
@@ -238,8 +238,17 @@ void visit_type_int64(Visitor *v, int64_t *obj, const char
*name, Error **errp)
void visit_type_size(Visitor *v, uint64_t *obj, const char *name, Error **errp)
{
+ int64_t value;
if (!error_is_set(errp)) {
- (v->type_size ? v->type_size : v->type_uint64)(v, obj, name, errp);
+ if (v->type_size) {
+ v->type_size(v, obj, name, errp);
+ } else if (v->type_uint64) {
+ v->type_uint64(v, obj, name, errp);
+ } else {
+ value = *obj;
+ v->type_int(v, &value, name, errp);
+ *obj = value;
+ }
}
}
--
1.7.1
- [Qemu-devel] [PATCH 00/16 RFC v6] ACPI memory hotplug, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 01/16] pc: use pci_hole64 info consistently, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 02/16] vl: set default ram_size during variable initialization, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 03/16] vl: convert -m to qemu_opts_parse(), Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 04/16] qapi: make visit_type_size fallback to type_int,
Igor Mammedov <=
- [Qemu-devel] [PATCH 05/16] qdev: Add SIZE type to qdev properties, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 06/16] dimm: implement dimm device abstraction, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 07/16] dimm: map DimmDevice into DimBus provided address space, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 08/16] pc: piix: make hotplug memory gap in high memory, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 09/16] pc: i440fx: add DimmBus to chipset and map it into hotplug memory region, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 10/16] dimm: add busy slot check and slot auto-allocation, Igor Mammedov, 2013/07/23