block/export: fix blk_size double byteswap
The config->blk_size field is little-endian. Use the native-endian
blk_size variable to avoid double byteswapping.
Fixes: 11f60f7eae
("block/export: make vhost-user-blk config space little-endian")
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20210223144653.811468-8-stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
e1fa7f5591
commit
a4f1542af5
@ -356,7 +356,7 @@ vu_blk_initialize_config(BlockDriverState *bs,
|
||||
config->num_queues = cpu_to_le16(num_queues);
|
||||
config->max_discard_sectors = cpu_to_le32(32768);
|
||||
config->max_discard_seg = cpu_to_le32(1);
|
||||
config->discard_sector_alignment = cpu_to_le32(config->blk_size >> 9);
|
||||
config->discard_sector_alignment = cpu_to_le32(blk_size >> 9);
|
||||
config->max_write_zeroes_sectors = cpu_to_le32(32768);
|
||||
config->max_write_zeroes_seg = cpu_to_le32(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user