Am Mi., 18. März 2026 um 00:23 Uhr schrieb Peter Xu <[email protected]>:
>
> Prepare for a new MARKER for non-NULL pointer.
>
> Signed-off-by: Peter Xu <[email protected]>

Reviewed-by: Alexander Mikhalitsyn <[email protected]>

> ---
>  include/migration/vmstate.h | 2 +-
>  migration/vmstate-types.c   | 4 ++--
>  tests/unit/test-vmstate.c   | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
> index b4bc69486d..092e8f7e9a 100644
> --- a/include/migration/vmstate.h
> +++ b/include/migration/vmstate.h
> @@ -283,7 +283,7 @@ extern const VMStateInfo vmstate_info_uint64;
>  extern const VMStateInfo vmstate_info_fd;
>
>  /** Put this in the stream when migrating a null pointer.*/
> -#define VMS_NULLPTR_MARKER (0x30U) /* '0' */
> +#define VMS_MARKER_PTR_NULL          (0x30U)   /* '0' */
>  extern const VMStateInfo vmstate_info_nullptr;
>
>  extern const VMStateInfo vmstate_info_cpudouble;
> diff --git a/migration/vmstate-types.c b/migration/vmstate-types.c
> index 23f3433696..7622cf8f01 100644
> --- a/migration/vmstate-types.c
> +++ b/migration/vmstate-types.c
> @@ -363,7 +363,7 @@ static bool load_nullptr(QEMUFile *f, void *pv, size_t 
> size,
>                           const VMStateField *field, Error **errp)
>
>  {
> -    if (qemu_get_byte(f) == VMS_NULLPTR_MARKER) {
> +    if (qemu_get_byte(f) == VMS_MARKER_PTR_NULL) {
>          return true;
>      }
>
> @@ -377,7 +377,7 @@ static bool save_nullptr(QEMUFile *f, void *pv, size_t 
> size,
>
>  {
>      if (pv == NULL) {
> -        qemu_put_byte(f, VMS_NULLPTR_MARKER);
> +        qemu_put_byte(f, VMS_MARKER_PTR_NULL);
>          return true;
>      }
>
> diff --git a/tests/unit/test-vmstate.c b/tests/unit/test-vmstate.c
> index 6a42cc1a4e..dae15786aa 100644
> --- a/tests/unit/test-vmstate.c
> +++ b/tests/unit/test-vmstate.c
> @@ -620,7 +620,7 @@ static void test_arr_ptr_str_no0_load(void)
>
>  static uint8_t wire_arr_ptr_0[] = {
>      0x00, 0x00, 0x00, 0x00,
> -    VMS_NULLPTR_MARKER,
> +    VMS_MARKER_PTR_NULL,
>      0x00, 0x00, 0x00, 0x02,
>      0x00, 0x00, 0x00, 0x03,
>      QEMU_VM_EOF
> --
> 2.50.1
>

Reply via email to