[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 10/17] qcow2: Set request_alignment during .bdrv_
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v2 10/17] qcow2: Set request_alignment during .bdrv_refresh_limits() |
Date: |
Tue, 14 Jun 2016 15:30:32 -0600 |
We want to eventually stick request_alignment alongside other
BlockLimits, but first, we must ensure it is populated at the
same time as all other limits, rather than being a special case
that is set only when a block is first opened.
Signed-off-by: Eric Blake <address@hidden>
---
v2: new patch
---
block/qcow2.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index c40baca..393afa9 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -975,9 +975,6 @@ static int qcow2_open(BlockDriverState *bs, QDict *options,
int flags,
}
bs->encrypted = 1;
-
- /* Encryption works on a sector granularity */
- bs->request_alignment = BDRV_SECTOR_SIZE;
}
s->l2_bits = s->cluster_bits - 3; /* L2 is always one cluster */
@@ -1196,6 +1193,10 @@ static void qcow2_refresh_limits(BlockDriverState *bs,
Error **errp)
{
BDRVQcow2State *s = bs->opaque;
+ if (bs->encrypted) {
+ /* Encryption works on a sector granularity */
+ bs->request_alignment = BDRV_SECTOR_SIZE;
+ }
bs->bl.pwrite_zeroes_alignment = s->cluster_size;
}
--
2.5.5
- [Qemu-devel] [PATCH v2 03/17] block: Fix harmless off-by-one in bdrv_aligned_preadv(), (continued)
- [Qemu-devel] [PATCH v2 03/17] block: Fix harmless off-by-one in bdrv_aligned_preadv(), Eric Blake, 2016/06/14
- [Qemu-devel] [PATCH v2 13/17] block: Set default request_alignment during bdrv_refresh_limits(), Eric Blake, 2016/06/14
- [Qemu-devel] [PATCH v2 11/17] raw-win32: Set request_alignment during .bdrv_refresh_limits(), Eric Blake, 2016/06/14
- [Qemu-devel] [PATCH v2 07/17] block: Give nonzero result to blk_get_max_transfer_length(), Eric Blake, 2016/06/14
- [Qemu-devel] [PATCH v2 10/17] qcow2: Set request_alignment during .bdrv_refresh_limits(),
Eric Blake <=
- [Qemu-devel] [PATCH v2 12/17] block: Set request_alignment during .bdrv_refresh_limits(), Eric Blake, 2016/06/14
- [Qemu-devel] [PATCH v2 06/17] iscsi: Advertise realistic limits to block layer, Eric Blake, 2016/06/14
- [Qemu-devel] [PATCH v2 15/17] block: Switch discard length bounds to byte-based, Eric Blake, 2016/06/14