[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-9.2 06/10] hw/remote/message.c: Don't directly invoke DeviceC
From: |
Peter Maydell |
Subject: |
[PATCH for-9.2 06/10] hw/remote/message.c: Don't directly invoke DeviceClass:reset |
Date: |
Tue, 13 Aug 2024 17:52:46 +0100 |
Directly invoking the DeviceClass::reset method is a bad idea,
because if the device is using three-phase reset then it relies on
transitional reset machinery which is likely to disappear at some
point.
Reset the device in the standard way, by calling device_cold_reset().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/remote/message.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/hw/remote/message.c b/hw/remote/message.c
index 50f6bf2d495..38ae6c75b4e 100644
--- a/hw/remote/message.c
+++ b/hw/remote/message.c
@@ -215,13 +215,10 @@ fail:
static void process_device_reset_msg(QIOChannel *ioc, PCIDevice *dev,
Error **errp)
{
- DeviceClass *dc = DEVICE_GET_CLASS(dev);
DeviceState *s = DEVICE(dev);
MPQemuMsg ret = { 0 };
- if (dc->reset) {
- dc->reset(s);
- }
+ device_cold_reset(s);
ret.cmd = MPQEMU_CMD_RET;
--
2.34.1
- Re: [PATCH for-9.2 03/10] hw: Remove device_class_set_parent_reset(), (continued)
- [PATCH for-9.2 04/10] target/alpha, hppa: Remove unused parent_reset fields, Peter Maydell, 2024/08/13
- [PATCH for-9.2 05/10] hw/dma/xilinx_axidma: Use semicolon at end of statement, not comma, Peter Maydell, 2024/08/13
- [PATCH for-9.2 09/10] hw: Rename DeviceClass::reset field to legacy_reset, Peter Maydell, 2024/08/13
- [PATCH for-9.2 06/10] hw/remote/message.c: Don't directly invoke DeviceClass:reset,
Peter Maydell <=
- [PATCH for-9.2 07/10] hw: Define new device_class_set_legacy_reset(), Peter Maydell, 2024/08/13
- [PATCH for-9.2 10/10] hw: Remove device_phases_reset(), Peter Maydell, 2024/08/13
- [PATCH for-9.2 08/10] hw: Use device_class_set_legacy_reset() instead of opencoding, Peter Maydell, 2024/08/13