clock-vmstate: Add missing END_OF_LIST
PATCH 1/1 clock-vmstate: Add missing END_OF_LIST
From: "Dr. David Alan Gilbert" <[email protected]>
Add the missing VMSTATE_END_OF_LIST to vmstate_muldiv
--- hw/core/clock-vmstate.c | 1 + 1 file changed, 1 insertion(+)
hw/core/clock-vmstate.c +1 -0
@@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = { .fields = (VMStateField[]) {VMSTATE_UINT32 (multiplier, Clock),VMSTATE_UINT32 (divider, Clock), +VMSTATE_END_OF_LIST () }, };
Signature · 1 line
2.34.1
Quoted 16 lines · Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" <[email protected]>
Add the missing
VMSTATE_END_OF_LISTtovmstate_muldivFixes 99abcbc7600 ("clock: Provide builtin multiplier/divider")Signed-off-by Dr. David Alan Gilbert <[email protected]>--- hw/core/clock-vmstate.c | 1 + 1 file changed, 1 insertion(+)hw/core/clock-vmstate.c +0
-0
hw/core/clock-vmstate.c const VMStateDescription vmstate_muldiv = { · line 49
Quoted 6 lines
hw/core/clock-vmstate.c +1
-0@@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = { .fields = (VMStateField[]) {VMSTATE_UINT32 (multiplier, Clock),VMSTATE_UINT32 (divider, Clock), +VMSTATE_END_OF_LIST () }, };
Oops :-(
We could maybe make this kind of bug more likely to be detected by instead of having the terminator be an "all zeros" VMStateField, having it check both for name == NULL and for a magic number in the VMStateFlags field. That way (assuming something in "make check" causes us to do a scan through every registered vmstate struct) forgetting the terminator will be likely to cause us to crash or hang rather than finding some 0 data and thinking that's the terminator.
thanks
-- PMM
Quoted 29 lines · * Peter Maydell ([email protected]) wrote:
Quoted 16 lines · Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" <[email protected]>
Add the missing
VMSTATE_END_OF_LISTtovmstate_muldivFixes 99abcbc7600 ("clock: Provide builtin multiplier/divider")Signed-off-by Dr. David Alan Gilbert <[email protected]>--- hw/core/clock-vmstate.c | 1 + 1 file changed, 1 insertion(+)hw/core/clock-vmstate.c +0
-0hw/core/clock-vmstate.c const VMStateDescription vmstate_muldiv = { · line 49
Quoted 6 lines
hw/core/clock-vmstate.c +1
-0@@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = { .fields = (VMStateField[]) {VMSTATE_UINT32 (multiplier, Clock),VMSTATE_UINT32 (divider, Clock), +VMSTATE_END_OF_LIST () }, };Oops :-(
Reviewed-by Peter Maydell <[email protected]>
Quoted 8 lines
We could maybe make this kind of bug more likely to be detected by instead of having the terminator be an "all zeros" VMStateField, having it check both for name == NULL and for a magic number in the VMStateFlags field. That way (assuming something in "make check" causes us to do a scan through every registered vmstate struct) forgetting the terminator will be likely to cause us to crash or hang rather than finding some 0 data and thinking that's the terminator.
Yeh, let me see what I can come up with for that.
Dave
Quoted 3 lines
thanks
-- PMM
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Quoted 16 lines · Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" <[email protected]>
Add the missing
VMSTATE_END_OF_LISTtovmstate_muldivFixes 99abcbc7600 ("clock: Provide builtin multiplier/divider")Signed-off-by Dr. David Alan Gilbert <[email protected]>--- hw/core/clock-vmstate.c | 1 + 1 file changed, 1 insertion(+)hw/core/clock-vmstate.c +0
-0
hw/core/clock-vmstate.c const VMStateDescription vmstate_muldiv = { · line 49
Quoted 6 lines
hw/core/clock-vmstate.c +1
-0@@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = { .fields = (VMStateField[]) {VMSTATE_UINT32 (multiplier, Clock),VMSTATE_UINT32 (divider, Clock), +VMSTATE_END_OF_LIST () }, };
Cc: [email protected]
seems appropriate here ?
thanks
-- PMM
Quoted 5 lines · Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" <[email protected]>
Add the missing
VMSTATE_END_OF_LISTtovmstate_muldivFixes 99abcbc7600 ("clock: Provide builtin multiplier/divider")
Doh I missed this too :(
Quoted 17 lines
Signed-off-by Dr. David Alan Gilbert <[email protected]>--- hw/core/clock-vmstate.c | 1 + 1 file changed, 1 insertion(+)hw/core/clock-vmstate.c +1
-0@@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = { .fields = (VMStateField[]) {VMSTATE_UINT32 (multiplier, Clock),VMSTATE_UINT32 (divider, Clock), +VMSTATE_END_OF_LIST () }, };
Quoted 6 lines · Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" <[email protected]>
Add the missing
VMSTATE_END_OF_LISTtovmstate_muldivFixes 99abcbc7600 ("clock: Provide builtin multiplier/divider")Signed-off-by Dr. David Alan Gilbert <[email protected]>
Signature · 1 line
Alex Bennée
Quoted 6 lines · Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" <[email protected]>
Add the missing
VMSTATE_END_OF_LISTtovmstate_muldivFixes 99abcbc7600 ("clock: Provide builtin multiplier/divider")Signed-off-by Dr. David Alan Gilbert <[email protected]>
Quoted 19 lines
--- hw/core/clock-vmstate.c | 1 + 1 file changed, 1 insertion(+)hw/core/clock-vmstate.c +1
-0@@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = { .fields = (VMStateField[]) {VMSTATE_UINT32 (multiplier, Clock),VMSTATE_UINT32 (divider, Clock), +VMSTATE_END_OF_LIST () }, };Signature · 1 line
2.34.1
Quoted 3 lines · * Dr. David Alan Gilbert (git) ([email protected]) wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
Add the missing
VMSTATE_END_OF_LISTtovmstate_muldiv
Queued
Quoted 23 lines
Fixes 99abcbc7600 ("clock: Provide builtin multiplier/divider")Signed-off-by Dr. David Alan Gilbert <[email protected]>--- hw/core/clock-vmstate.c | 1 + 1 file changed, 1 insertion(+)hw/core/clock-vmstate.c +1
-0@@ -44,6 +44,7 @@ const VMStateDescription vmstate_muldiv = { .fields = (VMStateField[]) {VMSTATE_UINT32 (multiplier, Clock),VMSTATE_UINT32 (divider, Clock), +VMSTATE_END_OF_LIST () }, };Signature · 1 line
2.34.1
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK