diff mbox series

[v2,4/9] hw/net: Replace dev->parent_bus by qdev_get_parent_bus(dev)

Message ID 20230213070423.76428-5-philmd@linaro.org
State New
Headers show
Series hw/qdev: Housekeeping around qdev_get_parent_bus() | expand

Commit Message

Philippe Mathieu-Daudé Feb. 13, 2023, 7:04 a.m. UTC
DeviceState::parent_bus is an internal field and should be
accessed by the qdev_get_parent_bus() helper.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/net/virtio-net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael S. Tsirkin Feb. 13, 2023, 10:52 a.m. UTC | #1
On Mon, Feb 13, 2023 at 08:04:18AM +0100, Philippe Mathieu-Daudé wrote:
> DeviceState::parent_bus is an internal field and should be
> accessed by the qdev_get_parent_bus() helper.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  hw/net/virtio-net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 3ae909041a..8bc160ab59 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -3423,7 +3423,7 @@ static bool failover_replug_primary(VirtIONet *n, DeviceState *dev,
>      if (!pdev->partially_hotplugged) {
>          return true;
>      }
> -    primary_bus = dev->parent_bus;
> +    primary_bus = qdev_get_parent_bus(dev);
>      if (!primary_bus) {
>          error_setg(errp, "virtio_net: couldn't find primary bus");
>          return false;
> -- 
> 2.38.1
diff mbox series

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 3ae909041a..8bc160ab59 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3423,7 +3423,7 @@  static bool failover_replug_primary(VirtIONet *n, DeviceState *dev,
     if (!pdev->partially_hotplugged) {
         return true;
     }
-    primary_bus = dev->parent_bus;
+    primary_bus = qdev_get_parent_bus(dev);
     if (!primary_bus) {
         error_setg(errp, "virtio_net: couldn't find primary bus");
         return false;