@samitouri / QOSamiQemu / commits / 695d481a12

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>

Hanna Czenczek committed May 30, 2025 at 10:44 UTC 695d481a12a1190e1dd71761f0393047f6e16932
1 file changed +1 -2
block/qcow2.c
+1 -2
@@ -4150,8 +4150,7 @@ qcow2_co_create_opts(BlockDriver *drv, const char *filename, QemuOpts *opts,
4150 }
4151
4152 /* Silently round up size */
4153 - create_options->u.qcow2.size = ROUND_UP(create_options->u.qcow2.size,
4154 - BDRV_SECTOR_SIZE);
4153 + qcow2_opts->size = ROUND_UP(qcow2_opts->size, BDRV_SECTOR_SIZE);
4154
4155 /* Create the qcow2 image (format layer) */
4156 ret = qcow2_co_create(create_options, errp);