diff mbox series

[12/13] migration: Use vmstate_register_any() for eeprom93xx

Message ID 20231019190831.20363-13-quintela@redhat.com
State Handled Elsewhere
Headers show
Series migration: Check for duplicates on vmstate_register() | expand

Commit Message

Juan Quintela Oct. 19, 2023, 7:08 p.m. UTC
We can have more than one eeprom93xx.
For instance:

e100_nic_realize() -> eeprom93xx_new()

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/nvram/eeprom93xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Berger Oct. 19, 2023, 8:39 p.m. UTC | #1
On 10/19/23 15:08, Juan Quintela wrote:
> We can have more than one eeprom93xx.
> For instance:
>
> e100_nic_realize() -> eeprom93xx_new()
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
> ---
>   hw/nvram/eeprom93xx.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/nvram/eeprom93xx.c b/hw/nvram/eeprom93xx.c
> index 1081e2cc0d..57d63638d7 100644
> --- a/hw/nvram/eeprom93xx.c
> +++ b/hw/nvram/eeprom93xx.c
> @@ -321,7 +321,7 @@ eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords)
>       /* Output DO is tristate, read results in 1. */
>       eeprom->eedo = 1;
>       logout("eeprom = 0x%p, nwords = %u\n", eeprom, nwords);
> -    vmstate_register(VMSTATE_IF(dev), 0, &vmstate_eeprom, eeprom);
> +    vmstate_register_any(VMSTATE_IF(dev), &vmstate_eeprom, eeprom);
>       return eeprom;
>   }
>
diff mbox series

Patch

diff --git a/hw/nvram/eeprom93xx.c b/hw/nvram/eeprom93xx.c
index 1081e2cc0d..57d63638d7 100644
--- a/hw/nvram/eeprom93xx.c
+++ b/hw/nvram/eeprom93xx.c
@@ -321,7 +321,7 @@  eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords)
     /* Output DO is tristate, read results in 1. */
     eeprom->eedo = 1;
     logout("eeprom = 0x%p, nwords = %u\n", eeprom, nwords);
-    vmstate_register(VMSTATE_IF(dev), 0, &vmstate_eeprom, eeprom);
+    vmstate_register_any(VMSTATE_IF(dev), &vmstate_eeprom, eeprom);
     return eeprom;
 }