aboutsummaryrefslogtreecommitdiff
path: root/block/vmdk.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2021-01-13 16:10:12 -0600
committerMarkus Armbruster <armbru@redhat.com>2021-01-28 08:08:45 +0100
commitc3033fd372fdaf5b89190136a74b3d78880b85d6 (patch)
tree6c2464ae3f51b43702c448606acb3a6c21b6b634 /block/vmdk.c
parentdc13f40c6ba291e31d09053815c230ed88c8921f (diff)
downloadqemu-c3033fd372fdaf5b89190136a74b3d78880b85d6.zip
qemu-c3033fd372fdaf5b89190136a74b3d78880b85d6.tar.gz
qemu-c3033fd372fdaf5b89190136a74b3d78880b85d6.tar.bz2
qapi: Use QAPI_LIST_APPEND in trivial cases
The easiest spots to use QAPI_LIST_APPEND are where we already have an obvious pointer to the tail of a list. While at it, consistently use the variable name 'tail' for that purpose. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210113221013.390592-5-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r--block/vmdk.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index a00dc00..4499f13 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -2928,7 +2928,7 @@ static ImageInfoSpecific *vmdk_get_specific_info(BlockDriverState *bs,
int i;
BDRVVmdkState *s = bs->opaque;
ImageInfoSpecific *spec_info = g_new0(ImageInfoSpecific, 1);
- ImageInfoList **next;
+ ImageInfoList **tail;
*spec_info = (ImageInfoSpecific){
.type = IMAGE_INFO_SPECIFIC_KIND_VMDK,
@@ -2943,12 +2943,9 @@ static ImageInfoSpecific *vmdk_get_specific_info(BlockDriverState *bs,
.parent_cid = s->parent_cid,
};
- next = &spec_info->u.vmdk.data->extents;
+ tail = &spec_info->u.vmdk.data->extents;
for (i = 0; i < s->num_extents; i++) {
- *next = g_new0(ImageInfoList, 1);
- (*next)->value = vmdk_get_extent_info(&s->extents[i]);
- (*next)->next = NULL;
- next = &(*next)->next;
+ QAPI_LIST_APPEND(tail, vmdk_get_extent_info(&s->extents[i]));
}
return spec_info;