hw/display: Constify VMState
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20231221031652.119827-27-richard.henderson@linaro.org>
diff --git a/hw/display/artist.c b/hw/display/artist.c
index fde050c..d913453 100644
--- a/hw/display/artist.c
+++ b/hw/display/artist.c
@@ -1435,7 +1435,7 @@
.version_id = 2,
.minimum_version_id = 2,
.post_load = vmstate_artist_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT16(height, ARTISTState),
VMSTATE_UINT16(width, ARTISTState),
VMSTATE_UINT16(depth, ARTISTState),
diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c
index a052776..e40ed2d 100644
--- a/hw/display/bcm2835_fb.c
+++ b/hw/display/bcm2835_fb.c
@@ -355,7 +355,7 @@
.name = TYPE_BCM2835_FB,
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_BOOL(lock, BCM2835FBState),
VMSTATE_BOOL(invalidate, BCM2835FBState),
VMSTATE_BOOL(pending, BCM2835FBState),
diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c
index 9138e98..3b1d922 100644
--- a/hw/display/bochs-display.c
+++ b/hw/display/bochs-display.c
@@ -61,7 +61,7 @@
static const VMStateDescription vmstate_bochs_display = {
.name = "bochs-display",
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_PCI_DEVICE(pci, BochsDisplayState),
VMSTATE_UINT16_ARRAY(vbe_regs, BochsDisplayState, VBE_DISPI_INDEX_NB),
VMSTATE_BOOL(big_endian_fb, BochsDisplayState),
diff --git a/hw/display/cg3.c b/hw/display/cg3.c
index 2e9656a..b271faa 100644
--- a/hw/display/cg3.c
+++ b/hw/display/cg3.c
@@ -334,7 +334,7 @@
.version_id = 1,
.minimum_version_id = 1,
.post_load = vmstate_cg3_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT16(height, CG3State),
VMSTATE_UINT16(width, CG3State),
VMSTATE_UINT16(depth, CG3State),
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index b80f98b..5dd5136 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -2739,7 +2739,7 @@
.version_id = 2,
.minimum_version_id = 1,
.post_load = cirrus_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(vga.latch, CirrusVGAState),
VMSTATE_UINT8(vga.sr_index, CirrusVGAState),
VMSTATE_BUFFER(vga.sr, CirrusVGAState),
@@ -2777,7 +2777,7 @@
.name = "cirrus_vga",
.version_id = 2,
.minimum_version_id = 2,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_PCI_DEVICE(dev, PCICirrusVGAState),
VMSTATE_STRUCT(cirrus_vga, PCICirrusVGAState, 0,
vmstate_cirrus_vga, CirrusVGAState),
diff --git a/hw/display/dpcd.c b/hw/display/dpcd.c
index 6446365..aab1b1a 100644
--- a/hw/display/dpcd.c
+++ b/hw/display/dpcd.c
@@ -135,7 +135,7 @@
.name = TYPE_DPCD,
.version_id = 0,
.minimum_version_id = 0,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT8_ARRAY_V(dpcd_info, DPCDState, DPCD_READABLE_AREA, 0),
VMSTATE_END_OF_LIST()
}
diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
index 34a960a..8468752 100644
--- a/hw/display/exynos4210_fimd.c
+++ b/hw/display/exynos4210_fimd.c
@@ -1865,7 +1865,7 @@
.name = "exynos4210.fimd_window",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(wincon, Exynos4210fimdWindow),
VMSTATE_UINT32_ARRAY(buf_start, Exynos4210fimdWindow, 3),
VMSTATE_UINT32_ARRAY(buf_end, Exynos4210fimdWindow, 3),
@@ -1895,7 +1895,7 @@
.version_id = 1,
.minimum_version_id = 1,
.post_load = exynos4210_fimd_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32_ARRAY(vidcon, Exynos4210fimdState, 4),
VMSTATE_UINT32_ARRAY(vidtcon, Exynos4210fimdState, 4),
VMSTATE_UINT32(shadowcon, Exynos4210fimdState),
diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c
index 2903cab..e08ec3f 100644
--- a/hw/display/g364fb.c
+++ b/hw/display/g364fb.c
@@ -455,7 +455,7 @@
.version_id = 2,
.minimum_version_id = 2,
.post_load = g364fb_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_BUFFER_UNSAFE(color_palette, G364State, 0, 256 * 3),
VMSTATE_BUFFER_UNSAFE(cursor_palette, G364State, 0, 9),
VMSTATE_UINT16_ARRAY(cursor, G364State, 512),
@@ -521,7 +521,7 @@
.name = "g364fb-sysbus",
.version_id = 2,
.minimum_version_id = 2,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_STRUCT(g364, G364SysBusState, 2, vmstate_g364fb, G364State),
VMSTATE_END_OF_LIST()
}
diff --git a/hw/display/i2c-ddc.c b/hw/display/i2c-ddc.c
index 1464895..3f9d1e1 100644
--- a/hw/display/i2c-ddc.c
+++ b/hw/display/i2c-ddc.c
@@ -88,7 +88,7 @@
static const VMStateDescription vmstate_i2c_ddc = {
.name = TYPE_I2CDDC,
.version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_BOOL(firstbyte, I2CDDCState),
VMSTATE_UINT8(reg, I2CDDCState),
VMSTATE_END_OF_LIST()
diff --git a/hw/display/jazz_led.c b/hw/display/jazz_led.c
index dd5f469..534f15d 100644
--- a/hw/display/jazz_led.c
+++ b/hw/display/jazz_led.c
@@ -257,7 +257,7 @@
.version_id = 0,
.minimum_version_id = 0,
.post_load = jazz_led_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT8(segments, LedState),
VMSTATE_END_OF_LIST()
}
diff --git a/hw/display/macfb.c b/hw/display/macfb.c
index d61541c..418e99c 100644
--- a/hw/display/macfb.c
+++ b/hw/display/macfb.c
@@ -627,7 +627,7 @@
.version_id = 1,
.minimum_version_id = 1,
.post_load = macfb_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT8(type, MacfbState),
VMSTATE_UINT8_ARRAY(color_palette, MacfbState, 256 * 3),
VMSTATE_UINT32(palette_current, MacfbState),
@@ -770,7 +770,7 @@
.name = "macfb-sysbus",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_STRUCT(macfb, MacfbSysBusState, 1, vmstate_macfb, MacfbState),
VMSTATE_END_OF_LIST()
}
@@ -789,7 +789,7 @@
.name = "macfb-nubus",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_STRUCT(macfb, MacfbNubusState, 1, vmstate_macfb, MacfbState),
VMSTATE_END_OF_LIST()
}
diff --git a/hw/display/pl110.c b/hw/display/pl110.c
index 4bf15c1..4b83db9 100644
--- a/hw/display/pl110.c
+++ b/hw/display/pl110.c
@@ -83,7 +83,7 @@
.version_id = 2,
.minimum_version_id = 1,
.post_load = vmstate_pl110_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_INT32(version, PL110State),
VMSTATE_UINT32_ARRAY(timing, PL110State, 4),
VMSTATE_UINT32(cr, PL110State),
diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c
index eb83d88..a9d0d98 100644
--- a/hw/display/pxa2xx_lcd.c
+++ b/hw/display/pxa2xx_lcd.c
@@ -1371,7 +1371,7 @@
.name = "dma_channel",
.version_id = 0,
.minimum_version_id = 0,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(branch, struct DMAChannel),
VMSTATE_UINT8(up, struct DMAChannel),
VMSTATE_BUFFER(pbuffer, struct DMAChannel),
@@ -1398,7 +1398,7 @@
.version_id = 0,
.minimum_version_id = 0,
.post_load = pxa2xx_lcdc_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_INT32(irqlevel, PXA2xxLCDState),
VMSTATE_INT32(transp, PXA2xxLCDState),
VMSTATE_UINT32_ARRAY(control, PXA2xxLCDState, 6),
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 7bb00d6..7178dec 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -2388,7 +2388,7 @@
.name = "qxl-memslot",
.version_id = QXL_SAVE_VERSION,
.minimum_version_id = QXL_SAVE_VERSION,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT64(slot.mem_start, struct guest_slots),
VMSTATE_UINT64(slot.mem_end, struct guest_slots),
VMSTATE_UINT32(active, struct guest_slots),
@@ -2400,7 +2400,7 @@
.name = "qxl-surface",
.version_id = QXL_SAVE_VERSION,
.minimum_version_id = QXL_SAVE_VERSION,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(width, QXLSurfaceCreate),
VMSTATE_UINT32(height, QXLSurfaceCreate),
VMSTATE_INT32(stride, QXLSurfaceCreate),
@@ -2419,7 +2419,7 @@
.version_id = 1,
.minimum_version_id = 1,
.needed = qxl_monitors_config_needed,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT64(guest_monitors_config, PCIQXLDevice),
VMSTATE_END_OF_LIST()
},
@@ -2432,7 +2432,7 @@
.pre_save = qxl_pre_save,
.pre_load = qxl_pre_load,
.post_load = qxl_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_PCI_DEVICE(pci, PCIQXLDevice),
VMSTATE_STRUCT(vga, PCIQXLDevice, 0, vmstate_vga_common, VGACommonState),
VMSTATE_UINT32(shadow_rom.mode, PCIQXLDevice),
@@ -2452,7 +2452,7 @@
VMSTATE_UINT64(guest_cursor, PCIQXLDevice),
VMSTATE_END_OF_LIST()
},
- .subsections = (const VMStateDescription*[]) {
+ .subsections = (const VMStateDescription * const []) {
&qxl_vmstate_monitors_config,
NULL
}
diff --git a/hw/display/ramfb-standalone.c b/hw/display/ramfb-standalone.c
index a96e7eb..20eab34 100644
--- a/hw/display/ramfb-standalone.c
+++ b/hw/display/ramfb-standalone.c
@@ -54,7 +54,7 @@
.version_id = 1,
.minimum_version_id = 1,
.needed = migrate_needed,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_STRUCT_POINTER(state, RAMFBStandaloneState, ramfb_vmstate, RAMFBState),
VMSTATE_END_OF_LIST()
}
diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c
index 477ef72..6086baf 100644
--- a/hw/display/ramfb.c
+++ b/hw/display/ramfb.c
@@ -129,7 +129,7 @@
.version_id = 1,
.minimum_version_id = 1,
.post_load = ramfb_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_BUFFER_UNSAFE(cfg, RAMFBState, 0, sizeof(RAMFBCfg)),
VMSTATE_END_OF_LIST()
}
diff --git a/hw/display/sii9022.c b/hw/display/sii9022.c
index 664fd40..60c3f78 100644
--- a/hw/display/sii9022.c
+++ b/hw/display/sii9022.c
@@ -51,7 +51,7 @@
.name = "sii9022",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_I2C_SLAVE(parent_obj, sii9022_state),
VMSTATE_UINT8(ptr, sii9022_state),
VMSTATE_BOOL(addr_byte, sii9022_state),
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 5b4e4509..26dc817 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -1940,7 +1940,7 @@
.name = "sm501-state",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(local_mem_size_index, SM501State),
VMSTATE_UINT32(system_control, SM501State),
VMSTATE_UINT32(misc_control, SM501State),
@@ -2071,7 +2071,7 @@
.name = TYPE_SYSBUS_SM501,
.version_id = 2,
.minimum_version_id = 2,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_STRUCT(state, SM501SysBusState, 1,
vmstate_sm501_state, SM501State),
VMSTATE_END_OF_LIST()
@@ -2161,7 +2161,7 @@
.name = TYPE_PCI_SM501,
.version_id = 2,
.minimum_version_id = 2,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_PCI_DEVICE(parent_obj, SM501PCIState),
VMSTATE_STRUCT(state, SM501PCIState, 1,
vmstate_sm501_state, SM501State),
diff --git a/hw/display/ssd0303.c b/hw/display/ssd0303.c
index 32b32a3..e292cff 100644
--- a/hw/display/ssd0303.c
+++ b/hw/display/ssd0303.c
@@ -281,7 +281,7 @@
.name = "ssd0303_oled",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_INT32(row, ssd0303_state),
VMSTATE_INT32(col, ssd0303_state),
VMSTATE_INT32(start_line, ssd0303_state),
diff --git a/hw/display/ssd0323.c b/hw/display/ssd0323.c
index 09b1bbe..96cf0dc 100644
--- a/hw/display/ssd0323.c
+++ b/hw/display/ssd0323.c
@@ -324,7 +324,7 @@
.version_id = 2,
.minimum_version_id = 2,
.post_load = ssd0323_post_load,
- .fields = (VMStateField []) {
+ .fields = (const VMStateField []) {
VMSTATE_UINT32(cmd_len, ssd0323_state),
VMSTATE_INT32(cmd, ssd0323_state),
VMSTATE_INT32_ARRAY(cmd_data, ssd0323_state, 8),
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index 1b27b64..99507e7 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -344,7 +344,7 @@
.version_id = 4,
.minimum_version_id = 4,
.post_load = vmstate_tcx_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT16(height, TCXState),
VMSTATE_UINT16(width, TCXState),
VMSTATE_UINT16(depth, TCXState),
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index e4f45b4..2d8adce 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -61,7 +61,7 @@
.name = "vga",
.version_id = 2,
.minimum_version_id = 2,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_PCI_DEVICE(dev, PCIVGAState),
VMSTATE_STRUCT(vga, PCIVGAState, 0, vmstate_vga_common, VGACommonState),
VMSTATE_END_OF_LIST()
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 37557c3..886a402 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -2106,7 +2106,7 @@
.version_id = 1,
.minimum_version_id = 1,
.needed = vga_endian_state_needed,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_BOOL(big_endian_fb, VGACommonState),
VMSTATE_END_OF_LIST()
}
@@ -2117,7 +2117,7 @@
.version_id = 2,
.minimum_version_id = 2,
.post_load = vga_common_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(latch, VGACommonState),
VMSTATE_UINT8(sr_index, VGACommonState),
VMSTATE_PARTIAL_BUFFER(sr, VGACommonState, 8),
@@ -2149,7 +2149,7 @@
VMSTATE_UINT32(vbe_bank_mask, VGACommonState),
VMSTATE_END_OF_LIST()
},
- .subsections = (const VMStateDescription*[]) {
+ .subsections = (const VMStateDescription * const []) {
&vmstate_vga_endian,
NULL
}
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index b016d3b..bae1c2a 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1164,7 +1164,7 @@
static const VMStateDescription vmstate_virtio_gpu_scanout = {
.name = "virtio-gpu-one-scanout",
.version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(resource_id, struct virtio_gpu_scanout),
VMSTATE_UINT32(width, struct virtio_gpu_scanout),
VMSTATE_UINT32(height, struct virtio_gpu_scanout),
@@ -1182,7 +1182,7 @@
static const VMStateDescription vmstate_virtio_gpu_scanouts = {
.name = "virtio-gpu-scanouts",
.version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_INT32(parent_obj.enable, struct VirtIOGPU),
VMSTATE_UINT32_EQUAL(parent_obj.conf.max_outputs,
struct VirtIOGPU, NULL),
@@ -1592,7 +1592,7 @@
.name = "virtio-gpu",
.minimum_version_id = VIRTIO_GPU_VM_VERSION,
.version_id = VIRTIO_GPU_VM_VERSION,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_VIRTIO_DEVICE /* core */,
{
.name = "virtio-gpu",
@@ -1605,7 +1605,7 @@
} /* device */,
VMSTATE_END_OF_LIST()
},
- .subsections = (const VMStateDescription * []) {
+ .subsections = (const VMStateDescription * const []) {
&vmstate_virtio_gpu_blob_state,
NULL
},
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index c8552ff..94d3353 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -88,7 +88,7 @@
.name = "virtio-vga",
.version_id = 2,
.minimum_version_id = 2,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
/* no pci stuff here, saving the virtio device will handle that */
VMSTATE_STRUCT(vga, VirtIOVGABase, 0,
vmstate_vga_common, VGACommonState),
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 3f26bea..1c0f9d9 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -1210,7 +1210,7 @@
.version_id = 0,
.minimum_version_id = 0,
.post_load = vmsvga_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_INT32_EQUAL(new_depth, struct vmsvga_state_s, NULL),
VMSTATE_INT32(enable, struct vmsvga_state_s),
VMSTATE_INT32(config, struct vmsvga_state_s),
@@ -1235,7 +1235,7 @@
.name = "vmware_vga",
.version_id = 0,
.minimum_version_id = 0,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_PCI_DEVICE(parent_obj, struct pci_vmsvga_state_s),
VMSTATE_STRUCT(chip, struct pci_vmsvga_state_s, 0,
vmstate_vmware_vga_internal, struct vmsvga_state_s),
diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c
index eee8f33..c42fc38 100644
--- a/hw/display/xlnx_dp.c
+++ b/hw/display/xlnx_dp.c
@@ -262,7 +262,7 @@
static const VMStateDescription vmstate_dp = {
.name = TYPE_XLNX_DP,
.version_id = 2,
- .fields = (VMStateField[]){
+ .fields = (const VMStateField[]){
VMSTATE_UINT32_ARRAY(core_registers, XlnxDPState,
DP_CORE_REG_ARRAY_SIZE),
VMSTATE_UINT32_ARRAY(avbufm_registers, XlnxDPState,