diff mbox series

[09/19] hw/virtio: Set QDev properties using QDev API

Message ID 20230203180914.49112-10-philmd@linaro.org
State New
Headers show
Series hw: Set QDev properties using QDev API (part 1/3) | expand

Commit Message

Philippe Mathieu-Daudé Feb. 3, 2023, 6:09 p.m. UTC
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 mbox series

Patch

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;