diff mbox series

[v2,03/15] linux-user/syscall: Do not open-code qdev_unrealize_and_unref()

Message ID 20230203145536.17585-4-philmd@linaro.org
State New
Headers show
Series hw: Use QOM alias properties and few QOM/QDev cleanups | expand

Commit Message

Philippe Mathieu-Daudé Feb. 3, 2023, 2:55 p.m. UTC
(See commits dc3edf8d8a "Convert to qdev_unrealize() manually"
 and 981c3dcd94 "Convert to qdev_unrealize() with Coccinelle").

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 linux-user/syscall.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Markus Armbruster Sept. 25, 2023, 10:30 a.m. UTC | #1
Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> (See commits dc3edf8d8a "Convert to qdev_unrealize() manually"
>  and 981c3dcd94 "Convert to qdev_unrealize() with Coccinelle").
>
> Reported-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Markus Armbruster <armbru@redhat.com>
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1f8c10f8ef..9299f71126 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8642,8 +8642,7 @@  static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
         if (CPU_NEXT(first_cpu)) {
             TaskState *ts = cpu->opaque;
 
-            object_property_set_bool(OBJECT(cpu), "realized", false, NULL);
-            object_unref(OBJECT(cpu));
+            qdev_unrealize_and_unref(DEVICE(cpu), NULL);
             /*
              * At this point the CPU should be unrealized and removed
              * from cpu lists. We can clean-up the rest of the thread