vmstate: Constify some VMStateDescriptions
authorKeqian Zhu <zhukeqian1@huawei.com>
Thu, 8 Apr 2021 14:07:06 +0000 (22:07 +0800)
committerLaurent Vivier <laurent@vivier.eu>
Sun, 2 May 2021 15:24:50 +0000 (17:24 +0200)
Constify vmstate_ecc_state and vmstate_x86_cpu.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210408140706.23412-1-zhukeqian1@huawei.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/block/ecc.c
include/hw/block/flash.h
target/i386/cpu.h
target/i386/machine.c

index 1a182367ee6325bc48b94c3f5aff0c8a4d4dbc89..6e0d63842c1412641f104df3fdfc5df822222706 100644 (file)
@@ -78,7 +78,7 @@ void ecc_reset(ECCState *s)
 }
 
 /* Save/restore */
-VMStateDescription vmstate_ecc_state = {
+const VMStateDescription vmstate_ecc_state = {
     .name = "ecc-state",
     .version_id = 0,
     .minimum_version_id = 0,
index 7dde0adcee78c160a4a2b94e7d551a09132ef240..86d8363bb09e6db797754cfd700ca549e3c0a9ba 100644 (file)
@@ -74,6 +74,6 @@ typedef struct {
 
 uint8_t ecc_digest(ECCState *s, uint8_t sample);
 void ecc_reset(ECCState *s);
-extern VMStateDescription vmstate_ecc_state;
+extern const VMStateDescription vmstate_ecc_state;
 
 #endif
index 570f916878f9ffa812593627adaee988695df7fe..1bc300ce85de366ece04b779f3b856c1a8371325 100644 (file)
@@ -1786,7 +1786,7 @@ struct X86CPU {
 
 
 #ifndef CONFIG_USER_ONLY
-extern VMStateDescription vmstate_x86_cpu;
+extern const VMStateDescription vmstate_x86_cpu;
 #endif
 
 int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request);
index 137604ddb898339e6ff06ebc440a013078857a55..f6f094f1c93888b8aa5f4a204aa9d7dfb410749e 100644 (file)
@@ -1396,7 +1396,7 @@ static const VMStateDescription vmstate_msr_tsx_ctrl = {
     }
 };
 
-VMStateDescription vmstate_x86_cpu = {
+const VMStateDescription vmstate_x86_cpu = {
     .name = "cpu",
     .version_id = 12,
     .minimum_version_id = 11,