qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 10/13] qom: Use machine_get_container()


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 10/13] qom: Use machine_get_container()
Date: Thu, 2 Jan 2025 14:58:26 +0100
User-agent: Mozilla Thunderbird

(Cc'ing qemu-block@ for floppy disc device)

On 21/11/24 20:21, Peter Xu wrote:
Use machine_get_container() whenever applicable across the tree.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
  hw/core/gpio.c        | 3 +--
  hw/core/qdev.c        | 3 +--
  hw/core/sysbus.c      | 4 ++--
  hw/i386/pc.c          | 4 ++--
  system/ioport.c       | 2 +-
  system/memory.c       | 2 +-
  system/qdev-monitor.c | 6 +++---
  system/vl.c           | 3 +--
  8 files changed, 12 insertions(+), 15 deletions(-)


diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 317aaca25a..b8ec2506e1 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -460,7 +460,7 @@ static int check_fdc(Object *obj, void *opaque)
  }
static const char * const fdc_container_path[] = {
-    "/unattached", "/peripheral", "/peripheral-anon"
+    "unattached", "peripheral", "peripheral-anon"
  };
/*
@@ -474,7 +474,7 @@ static ISADevice *pc_find_fdc0(void)
      CheckFdcState state = { 0 };
for (i = 0; i < ARRAY_SIZE(fdc_container_path); i++) {
-        container = container_get(qdev_get_machine(), fdc_container_path[i]);
+        container = machine_get_container(fdc_container_path[i]);
          object_child_foreach(container, check_fdc, &state);

Orthogonal to this series, but noticing while giving another look at
it. Is this method really using the correct API? It seems to poke at
a lower level.

      }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]