[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 49/54] block: support passthrough of BDRV_REQ_FUA in
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 49/54] block: support passthrough of BDRV_REQ_FUA in crypto driver |
Date: |
Fri, 6 Oct 2017 17:54:17 +0200 |
From: "Daniel P. Berrange" <address@hidden>
The BDRV_REQ_FUA flag can trivially be allowed in the crypt driver
as a passthrough to the underlying block driver.
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/crypto.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/block/crypto.c b/block/crypto.c
index edf53d49d1..60ddf8623e 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -279,6 +279,9 @@ static int block_crypto_open_generic(QCryptoBlockFormat
format,
return -EINVAL;
}
+ bs->supported_write_flags = BDRV_REQ_FUA &
+ bs->file->bs->supported_write_flags;
+
opts = qemu_opts_create(opts_spec, NULL, 0, &error_abort);
qemu_opts_absorb_qdict(opts, options, &local_err);
if (local_err) {
@@ -462,7 +465,7 @@ block_crypto_co_pwritev(BlockDriverState *bs, uint64_t
offset, uint64_t bytes,
uint64_t sector_size = qcrypto_block_get_sector_size(crypto->block);
uint64_t payload_offset = qcrypto_block_get_payload_offset(crypto->block);
- assert(!flags);
+ assert(!(flags & ~BDRV_REQ_FUA));
assert(payload_offset < INT64_MAX);
assert(QEMU_IS_ALIGNED(offset, sector_size));
assert(QEMU_IS_ALIGNED(bytes, sector_size));
@@ -495,7 +498,7 @@ block_crypto_co_pwritev(BlockDriverState *bs, uint64_t
offset, uint64_t bytes,
qemu_iovec_add(&hd_qiov, cipher_data, cur_bytes);
ret = bdrv_co_pwritev(bs->file, payload_offset + offset + bytes_done,
- cur_bytes, &hd_qiov, 0);
+ cur_bytes, &hd_qiov, flags);
if (ret < 0) {
goto cleanup;
}
--
2.13.6
- [Qemu-devel] [PULL 45/54] crypto: expose encryption sector size in APIs, (continued)
- [Qemu-devel] [PULL 45/54] crypto: expose encryption sector size in APIs, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 41/54] block: Add blkdebug hook for copy-on-read, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 42/54] block: Perform copy-on-read in loop, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 44/54] block: use 1 MB bounce buffers for crypto instead of 16KB, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 36/54] qemu-iotests: Test commit block job where top has two parents, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 43/54] iotests: Add test 197 for covering copy-on-read, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 47/54] block: convert crypto driver to bdrv_co_preadv|pwritev, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 50/54] block/mirror: check backing in bdrv_mirror_top_refresh_filename, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 48/54] block: convert qcrypto_block_encrypt|decrypt to take bytes offset, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 51/54] iotests: Fix 195 if IMGFMT is part of TEST_DIR, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 49/54] block: support passthrough of BDRV_REQ_FUA in crypto driver,
Kevin Wolf <=
- [Qemu-devel] [PULL 53/54] qcow2: truncate the tail of the image file after shrinking the image, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 54/54] block/mirror: check backing in bdrv_mirror_top_flush, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 52/54] qcow2: fix return error code in qcow2_truncate(), Kevin Wolf, 2017/10/06
- Re: [Qemu-devel] [PULL 00/54] Block layer patches, Peter Maydell, 2017/10/06