From: Peter Maydell Date: Tue, 13 Aug 2024 16:52:46 +0000 (+0100) Subject: hw/remote/message.c: Don't directly invoke DeviceClass:reset X-Git-Tag: qemu-xen-4.20.0~13^2~12 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7d3a421feab29c03601813c8a0f98d5b2fd4420a;p=qemu-xen.git hw/remote/message.c: Don't directly invoke DeviceClass:reset 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 Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240813165250.2717650-7-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- diff --git a/hw/remote/message.c b/hw/remote/message.c index 50f6bf2d49..38ae6c75b4 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;