mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
block: Don't enforce 512 byte minimum alignment
If block drivers say that they can do an alignment < 512 bytes, let's just suppose they mean it. raw-posix used to be an offender with respect to this, but it can actually deal with byte-aligned requests now. The default is still 512 bytes for any drivers that only implement sector-based interfaces, but it is 1 now for drivers that implement .bdrv_co_preadv. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
9d52aa3c38
commit
23b0d9fb1d
2 changed files with 4 additions and 6 deletions
2
block.c
2
block.c
|
@ -937,7 +937,7 @@ static int bdrv_open_common(BlockDriverState *bs, BdrvChild *file,
|
|||
goto fail_opts;
|
||||
}
|
||||
|
||||
bs->request_alignment = 512;
|
||||
bs->request_alignment = drv->bdrv_co_preadv ? 1 : 512;
|
||||
bs->zero_beyond_eof = true;
|
||||
bs->read_only = !(bs->open_flags & BDRV_O_RDWR);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue