hw/armv7m: Fix broken VMStateDescription
PATCH 1/1 hw/armv7m: Fix broken VMStateDescription
In commit d5093d961585f02 we added a VMStateDescription to the TYPE_ARMV7M object, to handle migration of its Clocks. However a cut-and-paste error meant we used the wrong struct name in the VMSTATE_CLOCK() macro arguments. The result was that attempting a 'savevm' might result in an assertion failure.
---
It's a shame there's no way to type-check that the struct name used in the VMSTATE macros is correct...
--- hw/arm/armv7m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/arm/armv7m.c +2 -2
@@ -520,8 +520,8 @@ static const VMStateDescription vmstate_armv7m = { .version_id = 1, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_CLOCK (refclk, SysTickState), -VMSTATE_CLOCK (cpuclk, SysTickState), +VMSTATE_CLOCK (refclk, ARMv7MState), +VMSTATE_CLOCK (cpuclk, ARMv7MState),VMSTATE_END_OF_LIST () } };
Signature · 1 line
2.25.1
Quoted 11 lines · Peter Maydell
In commit
d5093d961585f02we added a VMStateDescription to theTYPE_ARMV7Mobject, to handle migration of its Clocks. However a cut-and-paste error meant we used the wrong struct name in theVMSTATE_CLOCK()macro arguments. The result was that attempting a 'savevm' might result in an assertion failure.Fixes d5093d961585f02Signed-off-by Peter Maydell <[email protected]>
Quoted 27 lines
---
It's a shame there's no way to type-check that the struct name used in the VMSTATE macros is correct...--- hw/arm/armv7m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/arm/armv7m.c +2
-3@@ -520,8 +520,8 @@ static const VMStateDescription vmstate_armv7m = { .version_id = 1, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_CLOCK (refclk, SysTickState), -VMSTATE_CLOCK (cpuclk, SysTickState), +VMSTATE_CLOCK (refclk, ARMv7MState), +VMSTATE_CLOCK (cpuclk, ARMv7MState),VMSTATE_END_OF_LIST () } }; --2.25.1
Quoted 11 lines · Peter Maydell
In commit
d5093d961585f02we added a VMStateDescription to theTYPE_ARMV7Mobject, to handle migration of its Clocks. However a cut-and-paste error meant we used the wrong struct name in theVMSTATE_CLOCK()macro arguments. The result was that attempting a 'savevm' might result in an assertion failure.Fixes d5093d961585f02Signed-off-by Peter Maydell <[email protected]>
Signature · 1 line
Alex Bennée
Quoted 11 lines · Peter Maydell
In commit
d5093d961585f02we added a VMStateDescription to theTYPE_ARMV7Mobject, to handle migration of its Clocks. However a cut-and-paste error meant we used the wrong struct name in theVMSTATE_CLOCK()macro arguments. The result was that attempting a 'savevm' might result in an assertion failure.Fixes d5093d961585f02Signed-off-by Peter Maydell <[email protected]>
Quoted 6 lines
---
It's a shame there's no way to type-check that the struct name used in the VMSTATE macros is correct...--- hw/arm/armv7m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)