On 21/7/26 10:16, Akihiko Odaki wrote:
DeviceState fields should be accessed through qdev helpers rather than
directly. Use qdev_is_realized() instead of reading
DeviceState::realized directly.

Signed-off-by: Akihiko Odaki <[email protected]>
---
  hw/vfio/container-legacy.c | 4 ++--
  hw/vfio/device.c           | 4 ++--
  hw/vfio/iommufd.c          | 2 +-
  3 files changed, 5 insertions(+), 5 deletions(-)


diff --git a/hw/vfio/device.c b/hw/vfio/device.c
index 1a7f8088aad9..4f119596336f 100644
--- a/hw/vfio/device.c
+++ b/hw/vfio/device.c
@@ -59,13 +59,13 @@ void vfio_device_reset_handler(void *opaque)
trace_vfio_device_reset_handler();
      QLIST_FOREACH(vbasedev, &vfio_device_list, global_next) {
-        if (vbasedev->dev->realized) {
+        if (qdev_is_realized(vbasedev->dev)) {
              vbasedev->ops->vfio_compute_needs_reset(vbasedev);
          }
      }
QLIST_FOREACH(vbasedev, &vfio_device_list, global_next) {
-        if (vbasedev->dev->realized && vbasedev->needs_reset) {
+        if (qdev_is_realized(vbasedev->dev) && vbasedev->needs_reset) {
              vbasedev->ops->vfio_hot_reset_multi(vbasedev);
          }
      }

Interesting.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>


Reply via email to