Skip to content

Commit

Permalink
hw/i386: Constify VMState
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20231221031652.119827-32-richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Dec 29, 2023
1 parent 01d9442 commit 9231a01
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion hw/i386/acpi-build.c
Original file line number Diff line number Diff line change
Expand Up @@ -2770,7 +2770,7 @@ static const VMStateDescription vmstate_acpi_build = {
.name = "acpi_build",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT8(patched, AcpiBuildState),
VMSTATE_END_OF_LIST()
},
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/intel_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3289,7 +3289,7 @@ static const VMStateDescription vtd_vmstate = {
.minimum_version_id = 1,
.priority = MIG_PRI_IOMMU,
.post_load = vtd_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT64(root, IntelIOMMUState),
VMSTATE_UINT64(intr_root, IntelIOMMUState),
VMSTATE_UINT64(iq, IntelIOMMUState),
Expand Down
6 changes: 3 additions & 3 deletions hw/i386/kvm/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static const VMStateDescription kvmclock_reliable_get_clock = {
.version_id = 1,
.minimum_version_id = 1,
.needed = kvmclock_clock_is_reliable_needed,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_BOOL(clock_is_reliable, KVMClockState),
VMSTATE_END_OF_LIST()
}
Expand Down Expand Up @@ -295,11 +295,11 @@ static const VMStateDescription kvmclock_vmsd = {
.minimum_version_id = 1,
.pre_load = kvmclock_pre_load,
.pre_save = kvmclock_pre_save,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT64(clock, KVMClockState),
VMSTATE_END_OF_LIST()
},
.subsections = (const VMStateDescription * []) {
.subsections = (const VMStateDescription * const []) {
&kvmclock_reliable_get_clock,
NULL
}
Expand Down
4 changes: 2 additions & 2 deletions hw/i386/kvm/xen_evtchn.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static const VMStateDescription xen_evtchn_port_vmstate = {
.name = "xen_evtchn_port",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32(vcpu, XenEvtchnPort),
VMSTATE_UINT16(type, XenEvtchnPort),
VMSTATE_UINT16(u.val, XenEvtchnPort),
Expand All @@ -255,7 +255,7 @@ static const VMStateDescription xen_evtchn_vmstate = {
.needed = xen_evtchn_is_needed,
.pre_load = xen_evtchn_pre_load,
.post_load = xen_evtchn_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT64(callback_param, XenEvtchnState),
VMSTATE_UINT32(nr_ports, XenEvtchnState),
VMSTATE_STRUCT_VARRAY_UINT32(port_table, XenEvtchnState, nr_ports, 1,
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/kvm/xen_gnttab.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static const VMStateDescription xen_gnttab_vmstate = {
.minimum_version_id = 1,
.needed = xen_gnttab_is_needed,
.post_load = xen_gnttab_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32(nr_frames, XenGnttabState),
VMSTATE_VARRAY_UINT32(gnt_frame_gpas, XenGnttabState, nr_frames, 0,
vmstate_info_uint64, uint64_t),
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/kvm/xen_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static const VMStateDescription xen_overlay_vmstate = {
.needed = xen_overlay_is_needed,
.pre_save = xen_overlay_pre_save,
.post_load = xen_overlay_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT64(shinfo_gpa, XenOverlayState),
VMSTATE_BOOL(long_mode, XenOverlayState),
VMSTATE_END_OF_LIST()
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/kvm/xen_xenstore.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static const VMStateDescription xen_xenstore_vmstate = {
.needed = xen_xenstore_is_needed,
.pre_save = xen_xenstore_pre_save,
.post_load = xen_xenstore_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT8_ARRAY(req_data, XenXenstoreState,
sizeof_field(XenXenstoreState, req_data)),
VMSTATE_UINT8_ARRAY(rsp_data, XenXenstoreState,
Expand Down
6 changes: 3 additions & 3 deletions hw/i386/kvmvapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ static const VMStateDescription vmstate_handlers = {
.name = "kvmvapic-handlers",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32(set_tpr, VAPICHandlers),
VMSTATE_UINT32(set_tpr_eax, VAPICHandlers),
VMSTATE_UINT32_ARRAY(get_tpr, VAPICHandlers, 8),
Expand All @@ -815,7 +815,7 @@ static const VMStateDescription vmstate_guest_rom = {
.name = "kvmvapic-guest-rom",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UNUSED(8), /* signature */
VMSTATE_UINT32(vaddr, GuestROMState),
VMSTATE_UINT32(fixup_start, GuestROMState),
Expand All @@ -835,7 +835,7 @@ static const VMStateDescription vmstate_vapic = {
.version_id = 1,
.minimum_version_id = 1,
.post_load = vapic_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_STRUCT(rom_state, VAPICROMState, 0, vmstate_guest_rom,
GuestROMState),
VMSTATE_UINT32(state, VAPICROMState),
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/port92.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static const VMStateDescription vmstate_port92_isa = {
.name = "port92",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT8(outport, Port92State),
VMSTATE_END_OF_LIST()
}
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/vmmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ static const VMStateDescription vmstate_vmmouse = {
.version_id = 0,
.minimum_version_id = 0,
.post_load = vmmouse_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_INT32_EQUAL(queue_size, VMMouseState, NULL),
VMSTATE_UINT32_ARRAY(queue, VMMouseState, VMMOUSE_QUEUE_SIZE),
VMSTATE_UINT16(nb_queue, VMMouseState),
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/xen/xen_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ static const VMStateDescription vmstate_xen_platform = {
.version_id = 4,
.minimum_version_id = 4,
.post_load = xen_platform_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_PCI_DEVICE(parent_obj, PCIXenPlatformState),
VMSTATE_UINT8(flags, PCIXenPlatformState),
VMSTATE_END_OF_LIST()
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/xen/xen_pvdevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static const VMStateDescription vmstate_xen_pvdevice = {
.name = "xen-pvdevice",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_PCI_DEVICE(parent_obj, XenPVDevice),
VMSTATE_END_OF_LIST()
}
Expand Down

0 comments on commit 9231a01

Please sign in to comment.