[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v10 09/25] balloon: Improve use of qapi visitor
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v10 09/25] balloon: Improve use of qapi visitor |
Date: |
Fri, 29 Jan 2016 06:48:45 -0700 |
Rework the control flow of balloon_stats_get_all() to make it
easier for a later patch to split visit_end_struct(). Also
switch to the uint64 visitor to match the data type.
Signed-off-by: Eric Blake <address@hidden>
---
v10: defer out_nested label to later patch, drop Marc-Andre's R-b
v9: no change
v8: no change
v7: place earlier in series
v6: new patch, split from RFC on v5 7/46
---
hw/virtio/virtio-balloon.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 9671635..ba1d393 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -130,9 +130,11 @@ static void balloon_stats_get_all(Object *obj, struct
Visitor *v,
if (err) {
goto out_end;
}
- for (i = 0; !err && i < VIRTIO_BALLOON_S_NR; i++) {
- visit_type_int64(v, (int64_t *) &s->stats[i], balloon_stat_names[i],
- &err);
+ for (i = 0; i < VIRTIO_BALLOON_S_NR; i++) {
+ visit_type_uint64(v, &s->stats[i], balloon_stat_names[i], &err);
+ if (err) {
+ break;
+ }
}
error_propagate(errp, err);
err = NULL;
--
2.5.0
- [Qemu-devel] [PATCH v10 04/25] qapi: Dealloc visitor does not need a type_size(), (continued)
- [Qemu-devel] [PATCH v10 04/25] qapi: Dealloc visitor does not need a type_size(), Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 07/25] hmp: Cache use of qapi visitor, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 01/25] qobject: Document more shortcomings in our number handling, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 05/25] qapi: Drop dead parameter in gen_params(), Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 08/25] vl: Ensure qapi visitor properly ends struct visit, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 11/25] qapi: Track all failures between visit_start/stop, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 03/25] qapi: Drop dead dealloc visitor variable, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 13/25] qapi: Prefer type_int64 over type_int in visitors, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 14/25] qapi: Make all visitors supply uint64 callbacks, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 06/25] hmp: Drop pointless allocation during qapi visit, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 09/25] balloon: Improve use of qapi visitor,
Eric Blake <=
- [Qemu-devel] [PATCH v10 16/25] qapi: Don't cast Enum* to int*, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 02/25] qapi: Avoid use of misnamed DO_UPCAST(), Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 17/25] qom: Use typedef for Visitor, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 25/25] qmp: Don't abuse stack to track qmp-output root, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 15/25] qapi: Consolidate visitor small integer callbacks, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 22/25] qapi: Tighten qmp_input_end_list(), Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 23/25] qapi: Drop unused error argument for list and implicit struct, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 21/25] qapi: Drop unused 'kind' for struct/enum visit, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 10/25] qapi: Improve generated event use of qapi visitor, Eric Blake, 2016/01/29
- [Qemu-devel] [PATCH v10 24/25] qmp: Fix reference-counting of qnull on empty output visit, Eric Blake, 2016/01/29