Re: [Qemu-devel] [PATCH 01/13] block-crypto: misc refactoring
On Thu, 2019-08-22 at 16:34 +0200, Max Reitz wrote: > On 22.08.19 02:05, Maxim Levitsky wrote: > > On Tue, 2019-08-20 at 18:38 +0200, Max Reitz wrote: > > > On 14.08.19 22:22, Maxim Levitsky wrote: > > > > * rename the write_func to create_write_func, > > > > and init_func to create_init_func > > > > this is preparation for other write_func that will > > > > be used to update the encryption keys. > > > > > > > > No functional changes > > > > > > > > Signed-off-by: Maxim Levitsky > > > > --- > > > > block/crypto.c | 15 --- > > > > 1 file changed, 8 insertions(+), 7 deletions(-) > > > > > > > > > > I’m not quite sure why you remove or add blank lines seemingly at > > > random... > > > > Basically to have consistent two space separation between all functions. > > A bit of OCD I confess :-) > > Well, it didn’t work because in one place you added two empty lines > where we already had two, so there are four now. Exactly :-) While the reason I sometimes add/remove black lines between functions is this, this time this was just a leftover from some stuff I removed and forget to remove the black lines. Usually prior to sending the patches I 'polish' very carefully such stuff, but this time since I send up the RFC, I didn't do that that well thus various issues like that poped up. Best regards, Maxim Levitsky
Re: [Qemu-devel] [PATCH 01/13] block-crypto: misc refactoring
On 22.08.19 02:05, Maxim Levitsky wrote: > On Tue, 2019-08-20 at 18:38 +0200, Max Reitz wrote: >> On 14.08.19 22:22, Maxim Levitsky wrote: >>> * rename the write_func to create_write_func, >>> and init_func to create_init_func >>> this is preparation for other write_func that will >>> be used to update the encryption keys. >>> >>> No functional changes >>> >>> Signed-off-by: Maxim Levitsky >>> --- >>> block/crypto.c | 15 --- >>> 1 file changed, 8 insertions(+), 7 deletions(-) >>> >> >> I’m not quite sure why you remove or add blank lines seemingly at random... > > Basically to have consistent two space separation between all functions. > A bit of OCD I confess :-) Well, it didn’t work because in one place you added two empty lines where we already had two, so there are four now. Max signature.asc Description: OpenPGP digital signature
Re: [Qemu-devel] [PATCH 01/13] block-crypto: misc refactoring
On Wed, 2019-08-21 at 16:39 +0100, Daniel P. Berrangé wrote: > On Wed, Aug 14, 2019 at 11:22:07PM +0300, Maxim Levitsky wrote: > > * rename the write_func to create_write_func, > > and init_func to create_init_func > > this is preparation for other write_func that will > > be used to update the encryption keys. > > > > No functional changes > > > > Signed-off-by: Maxim Levitsky > > --- > > block/crypto.c | 15 --- > > 1 file changed, 8 insertions(+), 7 deletions(-) > > > > diff --git a/block/crypto.c b/block/crypto.c > > index 8237424ae6..42a3f0898b 100644 > > --- a/block/crypto.c > > +++ b/block/crypto.c > > @@ -51,7 +51,6 @@ static int block_crypto_probe_generic(QCryptoBlockFormat > > format, > > } > > } > > > > - > > Unrelated whitespace change > > > static ssize_t block_crypto_read_func(QCryptoBlock *block, > >size_t offset, > >uint8_t *buf, > > @@ -77,7 +76,7 @@ struct BlockCryptoCreateData { > > }; > > > > > > -static ssize_t block_crypto_write_func(QCryptoBlock *block, > > +static ssize_t block_crypto_create_write_func(QCryptoBlock *block, > > size_t offset, > > const uint8_t *buf, > > size_t buflen, > > Re-indent. > > > @@ -95,8 +94,7 @@ static ssize_t block_crypto_write_func(QCryptoBlock > > *block, > > return ret; > > } > > > > - > > Unrelated whitespace > > > -static ssize_t block_crypto_init_func(QCryptoBlock *block, > > +static ssize_t block_crypto_create_init_func(QCryptoBlock *block, > >size_t headerlen, > >void *opaque, > >Error **errp) > > Re-indent. > > > @@ -108,7 +106,8 @@ static ssize_t block_crypto_init_func(QCryptoBlock > > *block, > > return -EFBIG; > > } > > > > -/* User provided size should reflect amount of space made > > +/* > > + * User provided size should reflect amount of space made > > Unrelated whitespace > > > * available to the guest, so we must take account of that > > * which will be used by the crypto header > > */ > > @@ -117,6 +116,8 @@ static ssize_t block_crypto_init_func(QCryptoBlock > > *block, > > } > > > > > > + > > + > > Unrelated whitespace > > > static QemuOptsList block_crypto_runtime_opts_luks = { > > .name = "crypto", > > .head = QTAILQ_HEAD_INITIALIZER(block_crypto_runtime_opts_luks.head), > > @@ -272,8 +273,8 @@ static int > > block_crypto_co_create_generic(BlockDriverState *bs, > > }; > > > > crypto = qcrypto_block_create(opts, NULL, > > - block_crypto_init_func, > > - block_crypto_write_func, > > + block_crypto_create_init_func, > > + block_crypto_create_write_func, > >, > >errp); > > With the whitespace changes removed & indent fixed > > Reviewed-by: Daniel P. Berrangé > > > Regards, > Daniel Thanks you! Best regards, Maxim Levitsky
Re: [Qemu-devel] [PATCH 01/13] block-crypto: misc refactoring
On Tue, 2019-08-20 at 18:38 +0200, Max Reitz wrote: > On 14.08.19 22:22, Maxim Levitsky wrote: > > * rename the write_func to create_write_func, > > and init_func to create_init_func > > this is preparation for other write_func that will > > be used to update the encryption keys. > > > > No functional changes > > > > Signed-off-by: Maxim Levitsky > > --- > > block/crypto.c | 15 --- > > 1 file changed, 8 insertions(+), 7 deletions(-) > > > > I’m not quite sure why you remove or add blank lines seemingly at random... Basically to have consistent two space separation between all functions. A bit of OCD I confess :-) > > > diff --git a/block/crypto.c b/block/crypto.c > > index 8237424ae6..42a3f0898b 100644 > > --- a/block/crypto.c > > +++ b/block/crypto.c > > [...] > > > @@ -77,7 +76,7 @@ struct BlockCryptoCreateData { > > }; > > > > > > -static ssize_t block_crypto_write_func(QCryptoBlock *block, > > +static ssize_t block_crypto_create_write_func(QCryptoBlock *block, > > size_t offset, > > const uint8_t *buf, > > size_t buflen, > > Alignment should be kept at the opening parentheses. Opps. I am still trying to learn that rule. Fixed. > > But other than those two things, why not. > > Max > Best regards, Thanks for the review Maxim Levitsky
Re: [Qemu-devel] [PATCH 01/13] block-crypto: misc refactoring
On Wed, Aug 14, 2019 at 11:22:07PM +0300, Maxim Levitsky wrote: > * rename the write_func to create_write_func, > and init_func to create_init_func > this is preparation for other write_func that will > be used to update the encryption keys. > > No functional changes > > Signed-off-by: Maxim Levitsky > --- > block/crypto.c | 15 --- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/block/crypto.c b/block/crypto.c > index 8237424ae6..42a3f0898b 100644 > --- a/block/crypto.c > +++ b/block/crypto.c > @@ -51,7 +51,6 @@ static int block_crypto_probe_generic(QCryptoBlockFormat > format, > } > } > > - Unrelated whitespace change > static ssize_t block_crypto_read_func(QCryptoBlock *block, >size_t offset, >uint8_t *buf, > @@ -77,7 +76,7 @@ struct BlockCryptoCreateData { > }; > > > -static ssize_t block_crypto_write_func(QCryptoBlock *block, > +static ssize_t block_crypto_create_write_func(QCryptoBlock *block, > size_t offset, > const uint8_t *buf, > size_t buflen, Re-indent. > @@ -95,8 +94,7 @@ static ssize_t block_crypto_write_func(QCryptoBlock *block, > return ret; > } > > - Unrelated whitespace > -static ssize_t block_crypto_init_func(QCryptoBlock *block, > +static ssize_t block_crypto_create_init_func(QCryptoBlock *block, >size_t headerlen, >void *opaque, >Error **errp) Re-indent. > @@ -108,7 +106,8 @@ static ssize_t block_crypto_init_func(QCryptoBlock *block, > return -EFBIG; > } > > -/* User provided size should reflect amount of space made > +/* > + * User provided size should reflect amount of space made Unrelated whitespace > * available to the guest, so we must take account of that > * which will be used by the crypto header > */ > @@ -117,6 +116,8 @@ static ssize_t block_crypto_init_func(QCryptoBlock *block, > } > > > + > + Unrelated whitespace > static QemuOptsList block_crypto_runtime_opts_luks = { > .name = "crypto", > .head = QTAILQ_HEAD_INITIALIZER(block_crypto_runtime_opts_luks.head), > @@ -272,8 +273,8 @@ static int > block_crypto_co_create_generic(BlockDriverState *bs, > }; > > crypto = qcrypto_block_create(opts, NULL, > - block_crypto_init_func, > - block_crypto_write_func, > + block_crypto_create_init_func, > + block_crypto_create_write_func, >, >errp); With the whitespace changes removed & indent fixed Reviewed-by: Daniel P. Berrangé 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 :|
Re: [Qemu-devel] [PATCH 01/13] block-crypto: misc refactoring
On 14.08.19 22:22, Maxim Levitsky wrote: > * rename the write_func to create_write_func, > and init_func to create_init_func > this is preparation for other write_func that will > be used to update the encryption keys. > > No functional changes > > Signed-off-by: Maxim Levitsky > --- > block/crypto.c | 15 --- > 1 file changed, 8 insertions(+), 7 deletions(-) > I’m not quite sure why you remove or add blank lines seemingly at random... > diff --git a/block/crypto.c b/block/crypto.c > index 8237424ae6..42a3f0898b 100644 > --- a/block/crypto.c > +++ b/block/crypto.c [...] > @@ -77,7 +76,7 @@ struct BlockCryptoCreateData { > }; > > > -static ssize_t block_crypto_write_func(QCryptoBlock *block, > +static ssize_t block_crypto_create_write_func(QCryptoBlock *block, > size_t offset, > const uint8_t *buf, > size_t buflen, Alignment should be kept at the opening parentheses. But other than those two things, why not. Max signature.asc Description: OpenPGP digital signature
[Qemu-devel] [PATCH 01/13] block-crypto: misc refactoring
* rename the write_func to create_write_func, and init_func to create_init_func this is preparation for other write_func that will be used to update the encryption keys. No functional changes Signed-off-by: Maxim Levitsky --- block/crypto.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/block/crypto.c b/block/crypto.c index 8237424ae6..42a3f0898b 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -51,7 +51,6 @@ static int block_crypto_probe_generic(QCryptoBlockFormat format, } } - static ssize_t block_crypto_read_func(QCryptoBlock *block, size_t offset, uint8_t *buf, @@ -77,7 +76,7 @@ struct BlockCryptoCreateData { }; -static ssize_t block_crypto_write_func(QCryptoBlock *block, +static ssize_t block_crypto_create_write_func(QCryptoBlock *block, size_t offset, const uint8_t *buf, size_t buflen, @@ -95,8 +94,7 @@ static ssize_t block_crypto_write_func(QCryptoBlock *block, return ret; } - -static ssize_t block_crypto_init_func(QCryptoBlock *block, +static ssize_t block_crypto_create_init_func(QCryptoBlock *block, size_t headerlen, void *opaque, Error **errp) @@ -108,7 +106,8 @@ static ssize_t block_crypto_init_func(QCryptoBlock *block, return -EFBIG; } -/* User provided size should reflect amount of space made +/* + * User provided size should reflect amount of space made * available to the guest, so we must take account of that * which will be used by the crypto header */ @@ -117,6 +116,8 @@ static ssize_t block_crypto_init_func(QCryptoBlock *block, } + + static QemuOptsList block_crypto_runtime_opts_luks = { .name = "crypto", .head = QTAILQ_HEAD_INITIALIZER(block_crypto_runtime_opts_luks.head), @@ -272,8 +273,8 @@ static int block_crypto_co_create_generic(BlockDriverState *bs, }; crypto = qcrypto_block_create(opts, NULL, - block_crypto_init_func, - block_crypto_write_func, + block_crypto_create_init_func, + block_crypto_create_write_func, , errp); -- 2.17.2