Skip to content

Commit

Permalink
migration: Constify VMState
Browse files Browse the repository at this point in the history
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20231221031652.119827-67-richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Dec 29, 2023
1 parent ee1381c commit a77ffe9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion migration/global_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static const VMStateDescription vmstate_globalstate = {
.post_load = global_state_post_load,
.pre_save = global_state_pre_save,
.needed = global_state_needed,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32(size, GlobalState),
VMSTATE_BUFFER(runstate, GlobalState),
VMSTATE_END_OF_LIST()
Expand Down
10 changes: 5 additions & 5 deletions migration/savevm.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ static const VMStateDescription vmstate_target_page_bits = {
.version_id = 1,
.minimum_version_id = 1,
.needed = vmstate_target_page_bits_needed,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32(target_page_bits, SaveState),
VMSTATE_END_OF_LIST()
}
Expand All @@ -454,7 +454,7 @@ static const VMStateDescription vmstate_capabilites = {
.version_id = 1,
.minimum_version_id = 1,
.needed = vmstate_capabilites_needed,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32_V(caps_count, SaveState, 1),
VMSTATE_VARRAY_UINT32_ALLOC(capabilities, SaveState, caps_count, 1,
vmstate_info_capability,
Expand Down Expand Up @@ -499,7 +499,7 @@ static const VMStateDescription vmstate_uuid = {
.minimum_version_id = 1,
.needed = vmstate_uuid_needed,
.post_load = vmstate_uuid_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT8_ARRAY_V(uuid.data, SaveState, sizeof(QemuUUID), 1),
VMSTATE_END_OF_LIST()
}
Expand All @@ -512,12 +512,12 @@ static const VMStateDescription vmstate_configuration = {
.post_load = configuration_post_load,
.pre_save = configuration_pre_save,
.post_save = configuration_post_save,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32(len, SaveState),
VMSTATE_VBUFFER_ALLOC_UINT32(name, SaveState, 0, NULL, len),
VMSTATE_END_OF_LIST()
},
.subsections = (const VMStateDescription *[]) {
.subsections = (const VMStateDescription * const []) {
&vmstate_target_page_bits,
&vmstate_capabilites,
&vmstate_uuid,
Expand Down

0 comments on commit a77ffe9

Please sign in to comment.