Skip to content

Commit

Permalink
docs: Constify VMstate in examples
Browse files Browse the repository at this point in the history
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20231221031652.119827-72-richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Dec 29, 2023
1 parent 57c7398 commit 2563c97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/devel/clocks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ This is typically used to migrate an input clock state. For example:
VMStateDescription my_device_vmstate = {
.name = "my_device",
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
[...], /* other migrated fields */
VMSTATE_CLOCK(clk, MyDeviceState),
VMSTATE_END_OF_LIST()
Expand Down
8 changes: 4 additions & 4 deletions docs/devel/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ An example (from hw/input/pckbd.c)
.name = "pckbd",
.version_id = 3,
.minimum_version_id = 3,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT8(write_cmd, KBDState),
VMSTATE_UINT8(status, KBDState),
VMSTATE_UINT8(mode, KBDState),
Expand Down Expand Up @@ -294,7 +294,7 @@ Example:
.pre_save = ide_drive_pio_pre_save,
.post_load = ide_drive_pio_post_load,
.needed = ide_drive_pio_state_needed,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_INT32(req_nb_sectors, IDEState),
VMSTATE_VARRAY_INT32(io_buffer, IDEState, io_buffer_total_len, 1,
vmstate_info_uint8, uint8_t),
Expand All @@ -312,11 +312,11 @@ Example:
.version_id = 3,
.minimum_version_id = 0,
.post_load = ide_drive_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
.... several fields ....
VMSTATE_END_OF_LIST()
},
.subsections = (const VMStateDescription*[]) {
.subsections = (const VMStateDescription * const []) {
&vmstate_ide_drive_pio_state,
NULL
}
Expand Down

0 comments on commit 2563c97

Please sign in to comment.