Am 21.02.2017 um 12:55 hat Daniel P. Berrange geschrieben: > Instead of requiring separate input/output buffers for > encrypting data, change encrypt_sectors() to assume > use of a single buffer, encrypting in place. One current > caller uses the same buffer for input/output already > and the other two callers are easily converted to do so. > > Reviewed-by: Alberto Garcia <be...@igalia.com> > Reviewed-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Max Reitz <mre...@redhat.com> > Signed-off-by: Daniel P. Berrange <berra...@redhat.com>
> @@ -734,21 +729,15 @@ static coroutine_fn int qcow_co_writev(BlockDriverState > *bs, int64_t sector_num, > if (bs->encrypted) { > Error *err = NULL; > assert(s->cipher); > - if (!cluster_data) { > - cluster_data = g_malloc0(s->cluster_size); > - } > - if (encrypt_sectors(s, sector_num, cluster_data, buf, > + if (encrypt_sectors(s, sector_num, buf, > n, true, &err) < 0) { This fits in a single line now. Other than that: Reviewed-by: Kevinn Wolf <kw...@redhat.com>