提交 9dbb8fa7 编写于 作者: E Eric Blake 提交者: Markus Armbruster

balloon: Improve use of qapi visitor

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: NEric Blake <eblake@redhat.com>
Message-Id: <1454075341-13658-10-git-send-email-eblake@redhat.com>
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
上级 014791b0
......@@ -133,9 +133,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册