All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	qemu-riscv@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Eric Auger" <eric.auger@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Amit Shah" <amit@kernel.org>
Subject: [PATCH 09/19] hw/virtio: Set QDev properties using QDev API
Date: Fri,  3 Feb 2023 19:09:04 +0100	[thread overview]
Message-ID: <20230203180914.49112-10-philmd@linaro.org> (raw)
In-Reply-To: <20230203180914.49112-1-philmd@linaro.org>

No need to use the low-level QOM API when an object
inherits from QDev. Directly use the QDev API to set
its properties.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/display/virtio-gpu-pci.c  | 4 ++--
 hw/display/virtio-vga.c      | 4 ++--
 hw/virtio/virtio-iommu-pci.c | 3 +--
 hw/virtio/virtio-rng.c       | 3 +--
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index 93f214ff58..a2de06962b 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -39,8 +39,8 @@ static void virtio_gpu_pci_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     }
 
     for (i = 0; i < g->conf.max_outputs; i++) {
-        object_property_set_link(OBJECT(g->scanout[i].con), "device",
-                                 OBJECT(vpci_dev), &error_abort);
+        qdev_prop_set_link(DEVICE(g->scanout[i].con), "device",
+                           OBJECT(vpci_dev));
     }
 }
 
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index e6fb0aa876..1652d74657 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -160,8 +160,8 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     graphic_console_set_hwops(vga->con, &virtio_vga_base_ops, vvga);
 
     for (i = 0; i < g->conf.max_outputs; i++) {
-        object_property_set_link(OBJECT(g->scanout[i].con), "device",
-                                 OBJECT(vpci_dev), &error_abort);
+        qdev_prop_set_link(DEVICE(g->scanout[i].con), "device",
+                           OBJECT(vpci_dev));
     }
 }
 
diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c
index 7ef2f9dcdb..f7edcb39db 100644
--- a/hw/virtio/virtio-iommu-pci.c
+++ b/hw/virtio/virtio-iommu-pci.c
@@ -67,8 +67,7 @@ static void virtio_iommu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
         return;
     }
 
-    object_property_set_link(OBJECT(dev), "primary-bus",
-                             OBJECT(pbus), &error_abort);
+    qdev_prop_set_link(DEVICE(dev), "primary-bus", OBJECT(pbus));
 
     virtio_pci_force_virtio_1(vpci_dev);
     qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index 7e12fc03bf..6733e5b017 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -205,8 +205,7 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp)
         /* The child property took a reference, we can safely drop ours now */
         object_unref(default_backend);
 
-        object_property_set_link(OBJECT(dev), "rng", default_backend,
-                                 &error_abort);
+        qdev_prop_set_link(dev, "rng", default_backend);
     }
 
     vrng->rng = vrng->conf.rng;
-- 
2.38.1



  parent reply	other threads:[~2023-02-03 18:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 18:08 [PATCH 00/19] hw: Set QDev properties using QDev API (part 1/3) Philippe Mathieu-Daudé
2023-02-03 18:08 ` [PATCH 01/19] NOTFORMERGE scripts/coccinelle: Add qom-qdev-prop.cocci Philippe Mathieu-Daudé
2023-02-03 18:08 ` [PATCH 02/19] hw/qdev: Introduce qdev_prop_set_link() Philippe Mathieu-Daudé
2023-02-05 22:53   ` Mark Cave-Ayland
2023-02-03 18:08 ` [PATCH 03/19] hw/acpi: Set QDev properties using QDev API Philippe Mathieu-Daudé
2023-03-01 14:07   ` Igor Mammedov
2023-02-03 18:08 ` [PATCH 04/19] hw/audio: " Philippe Mathieu-Daudé
2023-02-03 18:09 ` [RFC PATCH 05/19] hw/core/numa: " Philippe Mathieu-Daudé
2023-03-01 14:09   ` Igor Mammedov
2023-02-03 18:09 ` [PATCH 06/19] hw/core/gpio: " Philippe Mathieu-Daudé
2023-02-03 18:09 ` [RFC PATCH 07/19] hw/scsi: " Philippe Mathieu-Daudé
2023-03-01 14:13   ` Igor Mammedov
2023-02-03 18:09 ` [PATCH 08/19] hw/usb: " Philippe Mathieu-Daudé
2023-02-03 18:09 ` Philippe Mathieu-Daudé [this message]
2023-02-03 18:09 ` [PATCH 10/19] hw/avr: " Philippe Mathieu-Daudé
2023-02-03 18:09 ` [PATCH 11/19] hw/hppa: " Philippe Mathieu-Daudé
2023-02-03 18:09 ` [RFC PATCH 12/19] hw/i386: " Philippe Mathieu-Daudé
2023-02-04 13:23   ` Bernhard Beschow
2023-03-01 14:00   ` Igor Mammedov
2023-02-03 18:09 ` [PATCH 13/19] hw/m68k: " Philippe Mathieu-Daudé
2023-02-05  9:14   ` Thomas Huth
2023-02-03 18:09 ` [PATCH 14/19] hw/microblaze: " Philippe Mathieu-Daudé
2023-02-03 18:09 ` [RFC PATCH 15/19] hw/mips: " Philippe Mathieu-Daudé
2023-02-03 18:09 ` [PATCH 16/19] hw/nios2: " Philippe Mathieu-Daudé
2023-02-03 18:09 ` [RFC PATCH 17/19] hw/riscv: " Philippe Mathieu-Daudé
2023-02-03 18:09 ` [PATCH 18/19] hw/rx: " Philippe Mathieu-Daudé
2023-02-06 13:01   ` Yoshinori Sato
2023-02-03 18:09 ` [PATCH 19/19] hw/sparc: " Philippe Mathieu-Daudé
2023-02-03 18:12 ` [PATCH 00/19] hw: Set QDev properties using QDev API (part 1/3) Philippe Mathieu-Daudé
2023-02-03 18:52   ` BALATON Zoltan
2023-03-01 13:42 ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230203180914.49112-10-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=amit@kernel.org \
    --cc=armbru@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=eric.auger@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.