mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
block: Drop superfluous aligning of bdrv_getlength()'s value
It returns a multiple of the sector size. Signed-off-by: Markus Armbruster <[email protected]> Reviewed-by: Max Reitz <[email protected]> Reviewed-by: Benoit Canet <[email protected]> Signed-off-by: Stefan Hajnoczi <[email protected]>
This commit is contained in:
1 parent
57322b7811
commit
75d3d21f9e
2 files changed
-2
No files matched your search
@@ -1314,7 +1314,6 @@ int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp)
|
||||
error_setg_errno(errp, -total_size, "Could not get image size");
|
||||
goto out;
|
||||
}
|
||||
total_size &= BDRV_SECTOR_MASK;
|
||||
|
||||
/* Create the temporary image */
|
||||
ret = get_tmp_filename(tmp_filename, PATH_MAX + 1);
|
||||
|
||||
@@ -1947,7 +1947,6 @@ static int qcow2_write_compressed(BlockDriverState *bs, int64_t sector_num,
|
||||
/* align end of file to a sector boundary to ease reading with
|
||||
sector based I/Os */
|
||||
cluster_offset = bdrv_getlength(bs->file);
|
||||
cluster_offset = (cluster_offset + 511) & ~511;
|
||||
bdrv_truncate(bs->file, cluster_offset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user