From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexander Graf <agraf@csgraf.de>,
QEMU Developers <qemu-devel@nongnu.org>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>,
Cameron Esfahani <dirty@apple.com>
Subject: Re: [PATCH] hvf: Determine slot count from struct layout
Date: Fri, 8 Oct 2021 19:18:45 +0200 [thread overview]
Message-ID: <c3317b7c-1210-23c6-1105-e1b4f76699c5@redhat.com> (raw)
In-Reply-To: <20211008054616.43828-1-agraf@csgraf.de>
On 08/10/21 07:46, Alexander Graf wrote:
> We can handle up to a static amount of memory slots, capped by the size of
> an internal array.
>
> Let's make sure that array size is the only source of truth for the number
> of elements in that array.
>
> Signed-off-by: Alexander Graf <agraf@csgraf.de>
> ---
> accel/hvf/hvf-accel-ops.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c
> index 6cbd2c3f97..2b2c411076 100644
> --- a/accel/hvf/hvf-accel-ops.c
> +++ b/accel/hvf/hvf-accel-ops.c
> @@ -321,7 +321,7 @@ static int hvf_accel_init(MachineState *ms)
>
> s = g_new0(HVFState, 1);
>
> - s->num_slots = 32;
> + s->num_slots = ARRAY_SIZE(s->slots);
> for (x = 0; x < s->num_slots; ++x) {
> s->slots[x].size = 0;
> s->slots[x].slot_id = x;
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2021-10-08 17:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-08 5:46 [PATCH] hvf: Determine slot count from struct layout Alexander Graf
2021-10-08 11:48 ` Richard Henderson
2021-10-08 17:18 ` Paolo Bonzini [this message]
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=c3317b7c-1210-23c6-1105-e1b4f76699c5@redhat.com \
--to=pbonzini@redhat.com \
--cc=agraf@csgraf.de \
--cc=dirty@apple.com \
--cc=qemu-devel@nongnu.org \
--cc=r.bolshakov@yadro.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 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).