[PATCH 2/2] cmd646: register vmstate_ide_pci VMStateDescription in DeviceClass

Mark Cave-Ayland posted 2 patches 5 years, 11 months ago
Maintainers: John Snow <jsnow@redhat.com>
[PATCH 2/2] cmd646: register vmstate_ide_pci VMStateDescription in DeviceClass
Posted by Mark Cave-Ayland 5 years, 11 months ago
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/ide/cmd646.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c
index 2f11d8de24..3c4f765bd6 100644
--- a/hw/ide/cmd646.c
+++ b/hw/ide/cmd646.c
@@ -301,8 +301,6 @@ static void pci_cmd646_ide_realize(PCIDevice *dev, Error **errp)
         ide_register_restart_cb(&d->bus[i]);
     }
     g_free(irq);
-
-    vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_pci, d);
 }
 
 static void pci_cmd646_ide_exitfn(PCIDevice *dev)
@@ -339,6 +337,7 @@ static void cmd646_ide_class_init(ObjectClass *klass, void *data)
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
 
     dc->reset = cmd646_reset;
+    dc->vmsd = &vmstate_ide_pci;
     k->realize = pci_cmd646_ide_realize;
     k->exit = pci_cmd646_ide_exitfn;
     k->vendor_id = PCI_VENDOR_ID_CMD;
-- 
2.20.1


Re: [PATCH 2/2] cmd646: register vmstate_ide_pci VMStateDescription in DeviceClass
Posted by Philippe Mathieu-Daudé 5 years, 11 months ago
On 3/7/20 4:15 PM, Mark Cave-Ayland wrote:
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>   hw/ide/cmd646.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c
> index 2f11d8de24..3c4f765bd6 100644
> --- a/hw/ide/cmd646.c
> +++ b/hw/ide/cmd646.c
> @@ -301,8 +301,6 @@ static void pci_cmd646_ide_realize(PCIDevice *dev, Error **errp)
>           ide_register_restart_cb(&d->bus[i]);
>       }
>       g_free(irq);
> -
> -    vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_pci, d);
>   }
>   
>   static void pci_cmd646_ide_exitfn(PCIDevice *dev)
> @@ -339,6 +337,7 @@ static void cmd646_ide_class_init(ObjectClass *klass, void *data)
>       PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
>   
>       dc->reset = cmd646_reset;
> +    dc->vmsd = &vmstate_ide_pci;
>       k->realize = pci_cmd646_ide_realize;
>       k->exit = pci_cmd646_ide_exitfn;
>       k->vendor_id = PCI_VENDOR_ID_CMD;
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>