[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 30/36] hw/virtio: Convert TYPE_VIRTIO_PCI to 3-phase reset
From: |
Peter Maydell |
Subject: |
[PULL 30/36] hw/virtio: Convert TYPE_VIRTIO_PCI to 3-phase reset |
Date: |
Fri, 16 Dec 2022 21:42:38 +0000 |
Convert the TYPE_VIRTIO_PCI class to 3-phase reset. This is
necessary so that we can convert the subclass TYPE_VIRTIO_VGA_BASE
also to 3-phase reset.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20221125115240.3005559-2-peter.maydell@linaro.org
---
hw/virtio/virtio-pci.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index a1c9dfa7bb5..7873083b860 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -2008,9 +2008,10 @@ static void virtio_pci_reset(DeviceState *qdev)
}
}
-static void virtio_pci_bus_reset(DeviceState *qdev)
+static void virtio_pci_bus_reset_hold(Object *obj)
{
- PCIDevice *dev = PCI_DEVICE(qdev);
+ PCIDevice *dev = PCI_DEVICE(obj);
+ DeviceState *qdev = DEVICE(obj);
virtio_pci_reset(qdev);
@@ -2071,6 +2072,7 @@ static void virtio_pci_class_init(ObjectClass *klass,
void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
VirtioPCIClass *vpciklass = VIRTIO_PCI_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
device_class_set_props(dc, virtio_pci_properties);
k->realize = virtio_pci_realize;
@@ -2080,7 +2082,7 @@ static void virtio_pci_class_init(ObjectClass *klass,
void *data)
k->class_id = PCI_CLASS_OTHERS;
device_class_set_parent_realize(dc, virtio_pci_dc_realize,
&vpciklass->parent_dc_realize);
- dc->reset = virtio_pci_bus_reset;
+ rc->phases.hold = virtio_pci_bus_reset_hold;
}
static const TypeInfo virtio_pci_info = {
--
2.25.1
- [PULL 21/36] target/nios2: Convert to 3-phase reset, (continued)
- [PULL 21/36] target/nios2: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 25/36] target/rx: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 24/36] target/riscv: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 26/36] target/sh4: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 32/36] pci: Convert TYPE_PCIE_ROOT_PORT to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 33/36] pci: Convert child classes of TYPE_PCIE_ROOT_PORT to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 23/36] target/ppc: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 27/36] target/sparc: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 29/36] target/xtensa: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 35/36] hw/intc/xics: Convert TYPE_ICS to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 30/36] hw/virtio: Convert TYPE_VIRTIO_PCI to 3-phase reset,
Peter Maydell <=
- [PULL 28/36] target/tricore: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 31/36] hw/display/virtio-vga: Convert TYPE_VIRTIO_VGA_BASE to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 34/36] hw/intc/xics: Reset TYPE_ICS objects with device_cold_reset(), Peter Maydell, 2022/12/16
- [PULL 36/36] hw/pci-host/pnv_phb3_msi: Convert TYPE_PHB3_MSI to 3-phase reset, Peter Maydell, 2022/12/16
- Re: [PULL 00/36] reset refactoring patches, Peter Maydell, 2022/12/17