Commit 695d481a12 for qemu.org
commit 695d481a12a1190e1dd71761f0393047f6e16932
Author: Hanna Czenczek <hreitz@redhat.com>
Date: Fri May 30 10:44:45 2025 +0200
qcow2: Simplify size round-up in co_create_opts
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>
diff --git a/block/qcow2.c b/block/qcow2.c
index e372880620..81fd299b4c 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);