@samitouri / QOSamiQemu / commits / 4ce421e8ed

vmstate: Rename VMS_NULLPTR_MARKER to VMS_MARKER_PTR_NULL

Prepare for a new MARKER for non-NULL pointer. Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io> Reviewed-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juraj Marcin <jmarcin@redhat.com> Link: https://lore.kernel.org/qemu-devel/20260401202844.673494-6-peterx@redhat.com Signed-off-by: Fabiano Rosas <farosas@suse.de>

Peter Xu committed Apr 1, 2026 at 16:28 UTC 4ce421e8edfb25e87028a8050f0ba968f24ebed1
3 files changed +4 -4
include/migration/vmstate.h
+1 -1
@@ -283,7 +283,7 @@ extern const VMStateInfo vmstate_info_uint64;
283 extern const VMStateInfo vmstate_info_fd;
284
285 /** Put this in the stream when migrating a null pointer.*/
286 -#define VMS_NULLPTR_MARKER (0x30U) /* '0' */
286 +#define VMS_MARKER_PTR_NULL (0x30U) /* '0' */
287 extern const VMStateInfo vmstate_info_nullptr;
288
289 extern const VMStateInfo vmstate_info_cpudouble;
migration/vmstate-types.c
+2 -2
@@ -363,7 +363,7 @@ static bool load_nullptr(QEMUFile *f, void *pv, size_t size,
363 const VMStateField *field, Error **errp)
364
365 {
366 - if (qemu_get_byte(f) == VMS_NULLPTR_MARKER) {
366 + if (qemu_get_byte(f) == VMS_MARKER_PTR_NULL) {
367 return true;
368 }
369
@@ -377,7 +377,7 @@ static bool save_nullptr(QEMUFile *f, void *pv, size_t size,
377
378 {
379 if (pv == NULL) {
380 - qemu_put_byte(f, VMS_NULLPTR_MARKER);
380 + qemu_put_byte(f, VMS_MARKER_PTR_NULL);
381 return true;
382 }
383
tests/unit/test-vmstate.c
+1 -1
@@ -620,7 +620,7 @@ static void test_arr_ptr_str_no0_load(void)
620
621 static uint8_t wire_arr_ptr_0[] = {
622 0x00, 0x00, 0x00, 0x00,
623 - VMS_NULLPTR_MARKER,
623 + VMS_MARKER_PTR_NULL,
624 0x00, 0x00, 0x00, 0x02,
625 0x00, 0x00, 0x00, 0x03,
626 QEMU_VM_EOF