[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 25/39] migration: Create vmstate_register_any()
From: |
Juan Quintela |
Subject: |
[PULL 25/39] migration: Create vmstate_register_any() |
Date: |
Tue, 24 Oct 2023 15:12:51 +0200 |
We have lots of cases where we are using an instance_id==0 when we
should be using VMSTATE_INSTANCE_ID_ANY (-1). Basically everything
that can have more than one needs to have a proper instance_id or -1
and the system will take one for it.
vmstate_register_any(): We register with -1.
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231020090731.28701-2-quintela@redhat.com>
---
include/migration/vmstate.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 1af181877c..1ea97ccf2d 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -1230,6 +1230,23 @@ static inline int vmstate_register(VMStateIf *obj, int
instance_id,
opaque, -1, 0, NULL);
}
+/**
+ * vmstate_register_any() - legacy function to register state
+ * serialisation description and let the function choose the id
+ *
+ * New code shouldn't be using this function as QOM-ified devices have
+ * dc->vmsd to store the serialisation description.
+ *
+ * Returns: 0 on success, -1 on failure
+ */
+static inline int vmstate_register_any(VMStateIf *obj,
+ const VMStateDescription *vmsd,
+ void *opaque)
+{
+ return vmstate_register_with_alias_id(obj, VMSTATE_INSTANCE_ID_ANY, vmsd,
+ opaque, -1, 0, NULL);
+}
+
void vmstate_unregister(VMStateIf *obj, const VMStateDescription *vmsd,
void *opaque);
--
2.41.0
- [PULL 14/39] migration: Export send_queued_data(), (continued)
- [PULL 14/39] migration: Export send_queued_data(), Juan Quintela, 2023/10/24
- [PULL 11/39] migration: Simplify compress_page_with_multithread(), Juan Quintela, 2023/10/24
- [PULL 16/39] migration: Merge flush_compressed_data() and compress_flush_data(), Juan Quintela, 2023/10/24
- [PULL 15/39] migration: Move ram_flush_compressed_data() to ram-compress.c, Juan Quintela, 2023/10/24
- [PULL 19/39] hw/s390x/s390-skeys: Don't call register_savevm_live() during instance_init(), Juan Quintela, 2023/10/24
- [PULL 18/39] hw/ipmi: Don't call vmstate_register() from instance_init() functions, Juan Quintela, 2023/10/24
- [PULL 20/39] hw/s390x/s390-stattrib: Simplify handling of the "migration-enabled" property, Juan Quintela, 2023/10/24
- [PULL 23/39] migration: rename vmstate_save_needed->vmstate_section_needed, Juan Quintela, 2023/10/24
- [PULL 21/39] hw/s390x/s390-stattrib: Don't call register_savevm_live() during instance_init(), Juan Quintela, 2023/10/24
- [PULL 22/39] migration/ram: Fix compilation with -Wshadow=local, Juan Quintela, 2023/10/24
- [PULL 25/39] migration: Create vmstate_register_any(),
Juan Quintela <=
- [PULL 17/39] migration: Rename ram_compressed_pages() to compress_ram_pages(), Juan Quintela, 2023/10/24
- [PULL 24/39] migration: set file error on subsection loading, Juan Quintela, 2023/10/24
- [PULL 07/39] migration: Give one error if trying to set MULTIFD and XBZRLE, Juan Quintela, 2023/10/24
- [PULL 29/39] migration: Hack to maintain backwards compatibility for ppc, Juan Quintela, 2023/10/24
- [PULL 27/39] migration: Use vmstate_register_any() for isa-ide, Juan Quintela, 2023/10/24
- [PULL 31/39] migration: Improve example and documentation of vmstate_register(), Juan Quintela, 2023/10/24
- [PULL 35/39] qemu-iotests: Filter warnings about block migration being deprecated, Juan Quintela, 2023/10/24
- [PULL 28/39] migration: Use VMSTATE_INSTANCE_ID_ANY for slirp, Juan Quintela, 2023/10/24
- [PULL 33/39] migration: Use vmstate_register_any() for eeprom93xx, Juan Quintela, 2023/10/24
- [PULL 30/39] migration: Check in savevm_state_handler_insert for dups, Juan Quintela, 2023/10/24