diff options
Diffstat (limited to 'block/raw-win32.c')
-rw-r--r-- | block/raw-win32.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/block/raw-win32.c b/block/raw-win32.c index 1e1880d528..9bf82252b8 100644 --- a/block/raw-win32.c +++ b/block/raw-win32.c @@ -511,8 +511,8 @@ static int raw_create(const char *filename, QemuOpts *opts, Error **errp) strstart(filename, "file:", &filename); /* Read out options */ - total_size = DIV_ROUND_UP(qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0), - BDRV_SECTOR_SIZE); + total_size = ROUND_UP(qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0), + BDRV_SECTOR_SIZE); fd = qemu_open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); @@ -521,7 +521,7 @@ static int raw_create(const char *filename, QemuOpts *opts, Error **errp) return -EIO; } set_sparse(fd); - ftruncate(fd, total_size * 512); + ftruncate(fd, total_size); qemu_close(fd); return 0; } |