From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, mreitz@redhat.com,
kwolf@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [PATCH v2 3/5] crypto/block: rename qcrypto_block_*crypt_helper
Date: Thu, 6 Dec 2018 10:39:14 +0000 [thread overview]
Message-ID: <20181206103914.GL29540@redhat.com> (raw)
In-Reply-To: <20181205144700.26563-4-vsementsov@virtuozzo.com>
On Wed, Dec 05, 2018 at 05:46:58PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> Rename qcrypto_block_*crypt_helper to qcrypto_cipher_*crypt_helper, as
> it's not about QCryptoBlock. This is needed to introduce
> qcrypto_block_*crypt_helper in the next commit, which will have
> QCryptoBlock pointer and than will be able to use additional fields of
> it, which in turn will be used to implement thread-safe QCryptoBlock
> operations.
The naming convention I'm following is that methods defined in a file
should all use the name of the file as their prefix. Hence everything
in crypto/block.* should be named with a qcrypto_block_ prefix
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> crypto/blockpriv.h | 34 +++++++++++++-------------
> crypto/block-luks.c | 44 +++++++++++++++++-----------------
> crypto/block-qcow.c | 16 ++++++-------
> crypto/block.c | 58 ++++++++++++++++++++++-----------------------
> 4 files changed, 76 insertions(+), 76 deletions(-)
>
> diff --git a/crypto/blockpriv.h b/crypto/blockpriv.h
> index 41840abcec..347a7c010a 100644
> --- a/crypto/blockpriv.h
> +++ b/crypto/blockpriv.h
> @@ -78,22 +78,22 @@ struct QCryptoBlockDriver {
> };
>
>
> -int qcrypto_block_decrypt_helper(QCryptoCipher *cipher,
> - size_t niv,
> - QCryptoIVGen *ivgen,
> - int sectorsize,
> - uint64_t offset,
> - uint8_t *buf,
> - size_t len,
> - Error **errp);
> -
> -int qcrypto_block_encrypt_helper(QCryptoCipher *cipher,
> - size_t niv,
> - QCryptoIVGen *ivgen,
> - int sectorsize,
> - uint64_t offset,
> - uint8_t *buf,
> - size_t len,
> - Error **errp);
> +int qcrypto_cipher_decrypt_helper(QCryptoCipher *cipher,
> + size_t niv,
> + QCryptoIVGen *ivgen,
> + int sectorsize,
> + uint64_t offset,
> + uint8_t *buf,
> + size_t len,
> + Error **errp);
> +
> +int qcrypto_cipher_encrypt_helper(QCryptoCipher *cipher,
> + size_t niv,
> + QCryptoIVGen *ivgen,
> + int sectorsize,
> + uint64_t offset,
> + uint8_t *buf,
> + size_t len,
> + Error **errp);
Rather than dropping 'block' from the method name, just add
'cipher'. eg
qcrypto_block_cipher_decrypt_helper
qcrypto_block_cipher_encrypt_helper
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2018-12-06 10:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 14:46 [Qemu-devel] [PATCH v2 0/5] crypto threads Vladimir Sementsov-Ogievskiy
2018-12-05 14:46 ` [Qemu-devel] [PATCH v2 1/5] crypto/block-luks: fix memory leak in qcrypto_block_luks_create Vladimir Sementsov-Ogievskiy
2018-12-06 10:34 ` Daniel P. Berrangé
2018-12-07 12:27 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2018-12-05 14:46 ` [Qemu-devel] [PATCH v2 2/5] crypto/block: refactor qcrypto_block_*crypt_helper functions Vladimir Sementsov-Ogievskiy
2018-12-06 10:36 ` Daniel P. Berrangé
2018-12-06 17:36 ` Vladimir Sementsov-Ogievskiy
2018-12-07 9:45 ` Daniel P. Berrangé
2018-12-07 12:37 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2018-12-05 14:46 ` [Qemu-devel] [PATCH v2 3/5] crypto/block: rename qcrypto_block_*crypt_helper Vladimir Sementsov-Ogievskiy
2018-12-06 10:39 ` Daniel P. Berrangé [this message]
2018-12-05 14:46 ` [Qemu-devel] [PATCH v2 4/5] crypto/block: introduce qcrypto_block_*crypt_helper functions Vladimir Sementsov-Ogievskiy
2018-12-06 10:39 ` Daniel P. Berrangé
2018-12-05 14:47 ` [Qemu-devel] [PATCH v2 5/5] crypto: support multiple threads accessing one QCryptoBlock Vladimir Sementsov-Ogievskiy
2018-12-06 10:54 ` Daniel P. Berrangé
2018-12-06 17:42 ` Vladimir Sementsov-Ogievskiy
2018-12-07 9:45 ` Daniel P. Berrangé
2018-12-07 14:44 ` Vladimir Sementsov-Ogievskiy
2018-12-07 14:45 ` Daniel P. Berrangé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181206103914.GL29540@redhat.com \
--to=berrange@redhat.com \
--cc=den@openvz.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.