diff mbox series

[RFC,05/19] accel/kvm: Prefer local AccelState over global MachineState::accel

Message ID 20250606164418.98655-6-philmd@linaro.org
State New
Headers show
Series accel: Preparatory cleanups for split-accel | expand

Commit Message

Philippe Mathieu-Daudé June 6, 2025, 4:44 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/kvm/kvm-all.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Richard Henderson June 7, 2025, 1:30 p.m. UTC | #1
On 6/6/25 17:44, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/kvm/kvm-all.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index 5b28b15ccec..551a462926d 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -2582,15 +2582,13 @@ static int kvm_init(MachineState *ms, AccelState *as)
>           { /* end of list */ }
>       }, *nc = num_cpus;
>       int soft_vcpus_limit, hard_vcpus_limit;
> -    KVMState *s;
> +    KVMState *s = KVM_STATE(as);
>       const KVMCapabilityInfo *missing_cap;
>       int ret;
>       int type;
>   
>       qemu_mutex_init(&kml_slots_lock);
>   
> -    s = KVM_STATE(ms->accelerator);
> -
>       /*
>        * On systems where the kernel can support different base page
>        * sizes, host page size may be different from TARGET_PAGE_SIZE,

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 5b28b15ccec..551a462926d 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2582,15 +2582,13 @@  static int kvm_init(MachineState *ms, AccelState *as)
         { /* end of list */ }
     }, *nc = num_cpus;
     int soft_vcpus_limit, hard_vcpus_limit;
-    KVMState *s;
+    KVMState *s = KVM_STATE(as);
     const KVMCapabilityInfo *missing_cap;
     int ret;
     int type;
 
     qemu_mutex_init(&kml_slots_lock);
 
-    s = KVM_STATE(ms->accelerator);
-
     /*
      * On systems where the kernel can support different base page
      * sizes, host page size may be different from TARGET_PAGE_SIZE,