]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel/hvf: Re-use QOM allocated state
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 6 Jun 2025 10:26:56 +0000 (12:26 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 4 Jul 2025 13:22:04 +0000 (15:22 +0200)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250606164418.98655-8-philmd@linaro.org>

accel/hvf/hvf-all.c

index 9e4012e2d10028749670232e18adb26615076d2b..df95ba74d6ed17bc434b415f8d72f466a9b4c7fd 100644 (file)
@@ -251,7 +251,7 @@ static int hvf_accel_init(AccelState *as, MachineState *ms)
 {
     int x;
     hv_return_t ret;
-    HVFState *s;
+    HVFState *s = HVF_STATE(as);
     int pa_range = 36;
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
@@ -270,8 +270,6 @@ static int hvf_accel_init(AccelState *as, MachineState *ms)
     }
     assert_hvf_ok(ret);
 
-    s = g_new0(HVFState, 1);
-
     s->num_slots = ARRAY_SIZE(s->slots);
     for (x = 0; x < s->num_slots; ++x) {
         s->slots[x].size = 0;