Skip to content
Snippets Groups Projects
Commit dec490db authored by Alexander Graf's avatar Alexander Graf Committed by Paolo Bonzini
Browse files

hvf: Determine slot count from struct layout


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: default avatarAlexander Graf <agraf@csgraf.de>
Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Message-Id: <20211008054616.43828-1-agraf@csgraf.de>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 8e751e9c
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment