qdev: Reset hot-plugged devices
PATCH 1/1 qdev: Reset hot-plugged devices
From: Jan Kiszka <[email protected]>
Device models rely on the core invoking their reset handlers after init. We do this in the cold-plug case, but so far we miss this step after hot-plug.
---
This is also one piece in the puzzle of getting CPU hot-plug work.
hw/qdev.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
hw/qdev.c +3 -0
@@ -265,6 +265,9 @@ DeviceState *qdev_device_add(QemuOpts *opts)return NULL ; } qdev->opts = opts; +if (qdev->hotplugged && qdev->info->reset) { + qdev->info->reset (qdev); + }return qdev; }
Signature · 1 line
1.7.3.4
PATCH v2 1/1 qdev: Reset hot-plugged devices
From: Jan Kiszka <[email protected]>
Device models rely on the core invoking their reset handlers after init. We do this in the cold-plug case, but so far we miss this step after hot-plug.
---
Changes in v2:
- move reset to qdev_init in case the device is created by the hot-plugged one (composed devices)
hw/qdev.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
hw/qdev.c +3 -0
@@ -289,6 +289,9 @@ int qdev_init(DeviceState *dev) dev->alias_required_for_version); } dev->state =DEV_STATE_INITIALIZED ; +if (dev->hotplugged && dev->info->reset) { + dev->info->reset (dev); + }return 0 ; }
Signature · 1 line
1.7.3.4
Anthony Liguori
AppliedQuoted 7 lines · Jan Kiszka
From: Jan Kiszka<[email protected]>
Device models rely on the core invoking their reset handlers after init. We do this in the cold-plug case, but so far we miss this step after hot-plug.
Signed-off-by Jan Kiszka<[email protected]>
Applied. Thanks.
Regards,
Anthony Liguori
Quoted 23 lines
---
Changes in v2:
- move reset toqdev_initin case the device is created by the hot-plugged one (composed devices)hw/qdev.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)hw/qdev.c +3
-0@@ -289,6 +289,9 @@ int qdev_init(DeviceState *dev) dev->alias_required_for_version); } dev->state =DEV_STATE_INITIALIZED ; +if (dev->hotplugged&& dev->info->reset) { + dev->info->reset (dev); + }return 0 ; }