aboutsummaryrefslogtreecommitdiff
path: root/crypto/block-luks.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2017-04-24 16:33:15 +0100
committerDaniel P. Berrange <berrange@redhat.com>2017-05-09 14:41:47 +0100
commite4a3507e86a1ef1453d603031bca27d5ac4cff3c (patch)
treeb5c8be68a0b8ed57d98ea8b273304ae1af0d9e09 /crypto/block-luks.c
parent899833cd65cafbdbae4b5b9da3b1c3726e13e299 (diff)
downloadqemu-e4a3507e86a1ef1453d603031bca27d5ac4cff3c.zip
qemu-e4a3507e86a1ef1453d603031bca27d5ac4cff3c.tar.gz
qemu-e4a3507e86a1ef1453d603031bca27d5ac4cff3c.tar.bz2
crypto: move 'opaque' parameter to (nearly) the end of parameter list
Previous commit moved 'opaque' to be the 2nd parameter in the list: commit 375092332eeaa6e47561ce47fd36144cdaf964d0 Author: Fam Zheng <famz@redhat.com> Date: Fri Apr 21 20:27:02 2017 +0800 crypto: Make errp the last parameter of functions Move opaque to 2nd instead of the 2nd to last, so that compilers help check with the conversion. this puts it back to the 2nd to last position. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'crypto/block-luks.c')
-rw-r--r--crypto/block-luks.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/crypto/block-luks.c b/crypto/block-luks.c
index d5a31bb..2b97d89 100644
--- a/crypto/block-luks.c
+++ b/crypto/block-luks.c
@@ -473,9 +473,9 @@ qcrypto_block_luks_load_key(QCryptoBlock *block,
* then encrypted.
*/
rv = readfunc(block,
- opaque,
slot->key_offset * QCRYPTO_BLOCK_LUKS_SECTOR_SIZE,
splitkey, splitkeylen,
+ opaque,
errp);
if (rv < 0) {
goto cleanup;
@@ -676,9 +676,10 @@ qcrypto_block_luks_open(QCryptoBlock *block,
/* Read the entire LUKS header, minus the key material from
* the underlying device */
- rv = readfunc(block, opaque, 0,
+ rv = readfunc(block, 0,
(uint8_t *)&luks->header,
sizeof(luks->header),
+ opaque,
errp);
if (rv < 0) {
ret = rv;
@@ -1245,7 +1246,7 @@ qcrypto_block_luks_create(QCryptoBlock *block,
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE;
/* Reserve header space to match payload offset */
- initfunc(block, opaque, block->payload_offset, &local_err);
+ initfunc(block, block->payload_offset, opaque, &local_err);
if (local_err) {
error_propagate(errp, local_err);
goto error;
@@ -1267,9 +1268,10 @@ qcrypto_block_luks_create(QCryptoBlock *block,
/* Write out the partition header and key slot headers */
- writefunc(block, opaque, 0,
+ writefunc(block, 0,
(const uint8_t *)&luks->header,
sizeof(luks->header),
+ opaque,
&local_err);
/* Delay checking local_err until we've byte-swapped */
@@ -1295,10 +1297,11 @@ qcrypto_block_luks_create(QCryptoBlock *block,
/* Write out the master key material, starting at the
* sector immediately following the partition header. */
- if (writefunc(block, opaque,
+ if (writefunc(block,
luks->header.key_slots[0].key_offset *
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE,
splitkey, splitkeylen,
+ opaque,
errp) != splitkeylen) {
goto error;
}