From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Subject: Re: [PATCH 2/2] qcow2: Convert qcow2_alloc_cluster_offset() into qcow2_alloc_host_offset()
Date: Mon, 14 Sep 2020 14:14:36 +0200 [thread overview]
Message-ID: <1c70b5a7-222c-0fbb-e8c8-c8c0000252fb@redhat.com> (raw)
In-Reply-To: <9bfef50ec9200d752413be4fc2aeb22a28378817.1599833007.git.berto@igalia.com>
[-- Attachment #1.1: Type: text/plain, Size: 1080 bytes --]
On 11.09.20 16:09, Alberto Garcia wrote:
> qcow2_alloc_cluster_offset() takes an (unaligned) guest offset and
> returns the (aligned) offset of the corresponding cluster in the qcow2
> image.
>
> In practice none of the callers need to know where the cluster starts
> so this patch makes the function calculate and return the final host
> offset directly. The function is also renamed accordingly.
>
> See 388e581615 for a similar change to qcow2_get_cluster_offset().
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
> block/qcow2.h | 6 +++---
> block/qcow2-cluster.c | 14 ++++++++++----
> block/qcow2.c | 36 +++++++++++++-----------------------
> 3 files changed, 26 insertions(+), 30 deletions(-)
First of all:
Reviewed-by: Max Reitz <mreitz@redhat.com>
However, I wonder what you think about “cluster_offset” in
qcow2_alloc_host_offset. It isn’t a cluster offset anymore. Can/should
we rename it?
(Perhaps call the parameter host_offset_ptr, and then rename the local
cluster_offset to host_offset?)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-09-14 12:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-11 14:09 [PATCH 0/2] Make preallocate_co() resize the image to the correct size Alberto Garcia
2020-09-11 14:09 ` [PATCH 1/2] qcow2: " Alberto Garcia
2020-09-14 12:14 ` Max Reitz
2020-09-15 9:29 ` Max Reitz
2020-09-15 9:37 ` Alberto Garcia
2020-09-11 14:09 ` [PATCH 2/2] qcow2: Convert qcow2_alloc_cluster_offset() into qcow2_alloc_host_offset() Alberto Garcia
2020-09-14 12:14 ` Max Reitz [this message]
2020-09-14 16:42 ` Alberto Garcia
2020-09-15 7:21 ` Max Reitz
2020-09-15 7:22 ` [PATCH 0/2] Make preallocate_co() resize the image to the correct size Max Reitz
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=1c70b5a7-222c-0fbb-e8c8-c8c0000252fb@redhat.com \
--to=mreitz@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).