diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2018-12-07 19:13:51 +0300 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2018-12-12 11:16:49 +0000 |
commit | c972fa123c73501b4b0c6de7873754ea3205a5eb (patch) | |
tree | bde968050ae58bb203988e66bfe1cbe7110d0fef /block/qcow2.c | |
parent | 0f0d596cb16a43314c8bc4a9afa2f966203fb05f (diff) | |
download | qemu-c972fa123c73501b4b0c6de7873754ea3205a5eb.zip qemu-c972fa123c73501b4b0c6de7873754ea3205a5eb.tar.gz qemu-c972fa123c73501b4b0c6de7873754ea3205a5eb.tar.bz2 |
crypto: support multiple threads accessing one QCryptoBlock
The two thing that should be handled are cipher and ivgen. For ivgen
the solution is just mutex, as iv calculations should not be long in
comparison with encryption/decryption. And for cipher let's just keep
per-thread ciphers.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r-- | block/qcow2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 991d6ac..bc8868c 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -294,7 +294,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, uint64_t start_offset, } s->crypto = qcrypto_block_open(s->crypto_opts, "encrypt.", qcow2_crypto_hdr_read_func, - bs, cflags, errp); + bs, cflags, 1, errp); if (!s->crypto) { return -EINVAL; } @@ -1445,7 +1445,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options, cflags |= QCRYPTO_BLOCK_OPEN_NO_IO; } s->crypto = qcrypto_block_open(s->crypto_opts, "encrypt.", - NULL, NULL, cflags, errp); + NULL, NULL, cflags, 1, errp); if (!s->crypto) { ret = -EINVAL; goto fail; |