From 5126609c0714c66a0ec41328017e7e8388c78bf4 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 13 Sep 2024 15:31:43 +0100 Subject: [PATCH 02/26] hw/s390/ccw-device: Convert to three-phase reset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Thomas Huth RH-MergeRequest: 351: Enable virtio-mem support on s390x RH-Jira: RHEL-72977 RH-Acked-by: David Hildenbrand RH-Acked-by: Juraj Marcin RH-Commit: [2/26] 58f6fc2e65a101e069feac399859464d31e43045 (thuth/qemu-kvm-cs) Convert the TYPE_CCW_DEVICE to three-phase reset. This is a device class which is subclassed, so it needs to be three-phase before we can convert the subclass. Signed-off-by: Peter Maydell Reviewed-by: Nina Schoetterl-Glausch Reviewed-by: Philippe Mathieu-Daudé Acked-by: Thomas Huth Message-id: 20240830145812.1967042-2-peter.maydell@linaro.org (cherry picked from commit 6a0e10b76b68e2f412746a1d5ed7d6efee804864) Signed-off-by: Thomas Huth --- hw/s390x/ccw-device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index d7bb364579..30f2fb486f 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -88,9 +88,9 @@ static Property ccw_device_properties[] = { DEFINE_PROP_END_OF_LIST(), }; -static void ccw_device_reset(DeviceState *d) +static void ccw_device_reset_hold(Object *obj, ResetType type) { - CcwDevice *ccw_dev = CCW_DEVICE(d); + CcwDevice *ccw_dev = CCW_DEVICE(obj); css_reset_sch(ccw_dev->sch); } @@ -99,11 +99,12 @@ static void ccw_device_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); CCWDeviceClass *k = CCW_DEVICE_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); k->realize = ccw_device_realize; k->refill_ids = ccw_device_refill_ids; device_class_set_props(dc, ccw_device_properties); - dc->reset = ccw_device_reset; + rc->phases.hold = ccw_device_reset_hold; dc->bus_type = TYPE_VIRTUAL_CSS_BUS; } -- 2.48.1