mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-07-01 07:14:48 +00:00
crypto/block: drop qcrypto_block_open() n_threads argument
The n_threads argument is no longer used since the previous commit. Remove it. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20240527155851.892885-3-stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Acked-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
af206c284e
commit
3ab0f063e5
|
@ -363,7 +363,6 @@ static int block_crypto_open_generic(QCryptoBlockFormat format,
|
||||||
block_crypto_read_func,
|
block_crypto_read_func,
|
||||||
bs,
|
bs,
|
||||||
cflags,
|
cflags,
|
||||||
1,
|
|
||||||
errp);
|
errp);
|
||||||
|
|
||||||
if (!crypto->block) {
|
if (!crypto->block) {
|
||||||
|
|
|
@ -211,7 +211,7 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
|
||||||
cflags |= QCRYPTO_BLOCK_OPEN_NO_IO;
|
cflags |= QCRYPTO_BLOCK_OPEN_NO_IO;
|
||||||
}
|
}
|
||||||
s->crypto = qcrypto_block_open(crypto_opts, "encrypt.",
|
s->crypto = qcrypto_block_open(crypto_opts, "encrypt.",
|
||||||
NULL, NULL, cflags, 1, errp);
|
NULL, NULL, cflags, errp);
|
||||||
if (!s->crypto) {
|
if (!s->crypto) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
@ -321,7 +321,7 @@ qcow2_read_extensions(BlockDriverState *bs, uint64_t start_offset,
|
||||||
}
|
}
|
||||||
s->crypto = qcrypto_block_open(s->crypto_opts, "encrypt.",
|
s->crypto = qcrypto_block_open(s->crypto_opts, "encrypt.",
|
||||||
qcow2_crypto_hdr_read_func,
|
qcow2_crypto_hdr_read_func,
|
||||||
bs, cflags, QCOW2_MAX_THREADS, errp);
|
bs, cflags, errp);
|
||||||
if (!s->crypto) {
|
if (!s->crypto) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -1701,8 +1701,7 @@ qcow2_do_open(BlockDriverState *bs, QDict *options, int flags,
|
||||||
cflags |= QCRYPTO_BLOCK_OPEN_NO_IO;
|
cflags |= QCRYPTO_BLOCK_OPEN_NO_IO;
|
||||||
}
|
}
|
||||||
s->crypto = qcrypto_block_open(s->crypto_opts, "encrypt.",
|
s->crypto = qcrypto_block_open(s->crypto_opts, "encrypt.",
|
||||||
NULL, NULL, cflags,
|
NULL, NULL, cflags, errp);
|
||||||
QCOW2_MAX_THREADS, errp);
|
|
||||||
if (!s->crypto) {
|
if (!s->crypto) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
@ -1189,7 +1189,6 @@ qcrypto_block_luks_open(QCryptoBlock *block,
|
||||||
QCryptoBlockReadFunc readfunc,
|
QCryptoBlockReadFunc readfunc,
|
||||||
void *opaque,
|
void *opaque,
|
||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
size_t n_threads,
|
|
||||||
Error **errp)
|
Error **errp)
|
||||||
{
|
{
|
||||||
QCryptoBlockLUKS *luks = NULL;
|
QCryptoBlockLUKS *luks = NULL;
|
||||||
|
|
|
@ -44,7 +44,6 @@ qcrypto_block_qcow_has_format(const uint8_t *buf G_GNUC_UNUSED,
|
||||||
static int
|
static int
|
||||||
qcrypto_block_qcow_init(QCryptoBlock *block,
|
qcrypto_block_qcow_init(QCryptoBlock *block,
|
||||||
const char *keysecret,
|
const char *keysecret,
|
||||||
size_t n_threads,
|
|
||||||
Error **errp)
|
Error **errp)
|
||||||
{
|
{
|
||||||
char *password;
|
char *password;
|
||||||
|
@ -100,7 +99,6 @@ qcrypto_block_qcow_open(QCryptoBlock *block,
|
||||||
QCryptoBlockReadFunc readfunc G_GNUC_UNUSED,
|
QCryptoBlockReadFunc readfunc G_GNUC_UNUSED,
|
||||||
void *opaque G_GNUC_UNUSED,
|
void *opaque G_GNUC_UNUSED,
|
||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
size_t n_threads,
|
|
||||||
Error **errp)
|
Error **errp)
|
||||||
{
|
{
|
||||||
if (flags & QCRYPTO_BLOCK_OPEN_NO_IO) {
|
if (flags & QCRYPTO_BLOCK_OPEN_NO_IO) {
|
||||||
|
@ -115,7 +113,7 @@ qcrypto_block_qcow_open(QCryptoBlock *block,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return qcrypto_block_qcow_init(block, options->u.qcow.key_secret,
|
return qcrypto_block_qcow_init(block, options->u.qcow.key_secret,
|
||||||
n_threads, errp);
|
errp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +133,7 @@ qcrypto_block_qcow_create(QCryptoBlock *block,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* QCow2 has no special header, since everything is hardwired */
|
/* QCow2 has no special header, since everything is hardwired */
|
||||||
return qcrypto_block_qcow_init(block, options->u.qcow.key_secret, 1, errp);
|
return qcrypto_block_qcow_init(block, options->u.qcow.key_secret, errp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,6 @@ QCryptoBlock *qcrypto_block_open(QCryptoBlockOpenOptions *options,
|
||||||
QCryptoBlockReadFunc readfunc,
|
QCryptoBlockReadFunc readfunc,
|
||||||
void *opaque,
|
void *opaque,
|
||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
size_t n_threads,
|
|
||||||
Error **errp)
|
Error **errp)
|
||||||
{
|
{
|
||||||
QCryptoBlock *block = g_new0(QCryptoBlock, 1);
|
QCryptoBlock *block = g_new0(QCryptoBlock, 1);
|
||||||
|
@ -73,7 +72,7 @@ QCryptoBlock *qcrypto_block_open(QCryptoBlockOpenOptions *options,
|
||||||
block->driver = qcrypto_block_drivers[options->format];
|
block->driver = qcrypto_block_drivers[options->format];
|
||||||
|
|
||||||
if (block->driver->open(block, options, optprefix,
|
if (block->driver->open(block, options, optprefix,
|
||||||
readfunc, opaque, flags, n_threads, errp) < 0)
|
readfunc, opaque, flags, errp) < 0)
|
||||||
{
|
{
|
||||||
g_free(block);
|
g_free(block);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -59,7 +59,6 @@ struct QCryptoBlockDriver {
|
||||||
QCryptoBlockReadFunc readfunc,
|
QCryptoBlockReadFunc readfunc,
|
||||||
void *opaque,
|
void *opaque,
|
||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
size_t n_threads,
|
|
||||||
Error **errp);
|
Error **errp);
|
||||||
|
|
||||||
int (*create)(QCryptoBlock *block,
|
int (*create)(QCryptoBlock *block,
|
||||||
|
|
|
@ -76,7 +76,6 @@ typedef enum {
|
||||||
* @readfunc: callback for reading data from the volume
|
* @readfunc: callback for reading data from the volume
|
||||||
* @opaque: data to pass to @readfunc
|
* @opaque: data to pass to @readfunc
|
||||||
* @flags: bitmask of QCryptoBlockOpenFlags values
|
* @flags: bitmask of QCryptoBlockOpenFlags values
|
||||||
* @n_threads: allow concurrent I/O from up to @n_threads threads
|
|
||||||
* @errp: pointer to a NULL-initialized error object
|
* @errp: pointer to a NULL-initialized error object
|
||||||
*
|
*
|
||||||
* Create a new block encryption object for an existing
|
* Create a new block encryption object for an existing
|
||||||
|
@ -113,7 +112,6 @@ QCryptoBlock *qcrypto_block_open(QCryptoBlockOpenOptions *options,
|
||||||
QCryptoBlockReadFunc readfunc,
|
QCryptoBlockReadFunc readfunc,
|
||||||
void *opaque,
|
void *opaque,
|
||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
size_t n_threads,
|
|
||||||
Error **errp);
|
Error **errp);
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
@ -303,7 +303,6 @@ static void test_block(gconstpointer opaque)
|
||||||
test_block_read_func,
|
test_block_read_func,
|
||||||
&header,
|
&header,
|
||||||
0,
|
0,
|
||||||
1,
|
|
||||||
NULL);
|
NULL);
|
||||||
g_assert(blk == NULL);
|
g_assert(blk == NULL);
|
||||||
|
|
||||||
|
@ -312,7 +311,6 @@ static void test_block(gconstpointer opaque)
|
||||||
test_block_read_func,
|
test_block_read_func,
|
||||||
&header,
|
&header,
|
||||||
QCRYPTO_BLOCK_OPEN_NO_IO,
|
QCRYPTO_BLOCK_OPEN_NO_IO,
|
||||||
1,
|
|
||||||
&error_abort);
|
&error_abort);
|
||||||
|
|
||||||
g_assert(qcrypto_block_get_cipher(blk) == NULL);
|
g_assert(qcrypto_block_get_cipher(blk) == NULL);
|
||||||
|
@ -327,7 +325,6 @@ static void test_block(gconstpointer opaque)
|
||||||
test_block_read_func,
|
test_block_read_func,
|
||||||
&header,
|
&header,
|
||||||
0,
|
0,
|
||||||
1,
|
|
||||||
&error_abort);
|
&error_abort);
|
||||||
g_assert(blk);
|
g_assert(blk);
|
||||||
|
|
||||||
|
@ -384,7 +381,6 @@ test_luks_bad_header(gconstpointer data)
|
||||||
test_block_read_func,
|
test_block_read_func,
|
||||||
&buf,
|
&buf,
|
||||||
0,
|
0,
|
||||||
1,
|
|
||||||
&err);
|
&err);
|
||||||
g_assert(!blk);
|
g_assert(!blk);
|
||||||
g_assert(err);
|
g_assert(err);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user