aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/virtio-pci.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2022-11-25 11:52:34 +0000
committerPeter Maydell <peter.maydell@linaro.org>2022-12-16 15:59:07 +0000
commit54da41834fc8d19004ab2401074b3f70d518aef0 (patch)
treea3f3f8d06b353609bcf936a2b30c9d63dd24c352 /hw/virtio/virtio-pci.c
parentd66e64dd006dfbc08f5395e1ca674903d46fa601 (diff)
downloadqemu-54da41834fc8d19004ab2401074b3f70d518aef0.zip
qemu-54da41834fc8d19004ab2401074b3f70d518aef0.tar.gz
qemu-54da41834fc8d19004ab2401074b3f70d518aef0.tar.bz2
hw/virtio: Convert TYPE_VIRTIO_PCI to 3-phase reset
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
Diffstat (limited to 'hw/virtio/virtio-pci.c')
-rw-r--r--hw/virtio/virtio-pci.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index a1c9dfa..7873083 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 = {