[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 06/31] balloon: Improve use of qapi visitor
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v7 06/31] balloon: Improve use of qapi visitor |
Date: |
Mon, 7 Dec 2015 20:54:56 -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>
---
v7: place earlier in series
v6: new patch, split from RFC on v5 7/46
---
hw/virtio/virtio-balloon.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 9671635..1ce987a 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -130,10 +130,13 @@ 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) {
+ goto out_nested;
+ }
}
+out_nested:
error_propagate(errp, err);
err = NULL;
visit_end_struct(v, &err);
--
2.4.3
- [Qemu-devel] [PATCH v7 00/31] qapi visitor cleanups (post-introspection cleanups subset E), Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 04/31] hmp: Improve use of qapi visitor, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 06/31] balloon: Improve use of qapi visitor,
Eric Blake <=
- [Qemu-devel] [PATCH v7 03/31] qapi: Drop dead dealloc visitor variable, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 01/31] qobject: Document more shortcomings in our number handling, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 11/31] qapi: Consolidate visitor small integer callbacks, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 05/31] vl: Improve use of qapi visitor, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 02/31] qapi: Avoid use of misnamed DO_UPCAST(), Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 10/31] qapi: Make all visitors supply uint64 callbacks, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 12/31] qapi: Don't cast Enum* to int*, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 15/31] qmp: Fix reference-counting of qnull on empty output visit, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 13/31] qapi: Drop unused 'kind' for struct/enum visit, Eric Blake, 2015/12/07