[PULL 10/12] qcow2: Simplify size round-up in co_create_opts

Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, Peter Lieven <pl@dlhnet.de>, Alberto Garcia <berto@igalia.com>, Fam Zheng <fam@euphon.net>, Markus Armbruster <armbru@redhat.com>, "Dr. David Alan Gilbert" <dave@treblig.org>, Eric Blake <eblake@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, "Marc-André Lureau" <marcandre.lureau@redhat.com>
There is a newer version of this series
[PULL 10/12] qcow2: Simplify size round-up in co_create_opts
Posted by Kevin Wolf 1 month, 1 week ago
From: Hanna Czenczek <hreitz@redhat.com>

Use the now-existing qcow2_opts pointer to simplify the size rounding up
code.

Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
Message-ID: <20250530084448.192369-3-hreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index e3728806203..81fd299b4c7 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -4150,8 +4150,7 @@ qcow2_co_create_opts(BlockDriver *drv, const char *filename, QemuOpts *opts,
     }
 
     /* Silently round up size */
-    create_options->u.qcow2.size = ROUND_UP(create_options->u.qcow2.size,
-                                            BDRV_SECTOR_SIZE);
+    qcow2_opts->size = ROUND_UP(qcow2_opts->size, BDRV_SECTOR_SIZE);
 
     /* Create the qcow2 image (format layer) */
     ret = qcow2_co_create(create_options, errp);
-- 
2.53.0