[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/39] migration: Improve example and documentation of vmstate_reg
From: |
Juan Quintela |
Subject: |
[PULL 31/39] migration: Improve example and documentation of vmstate_register() |
Date: |
Tue, 24 Oct 2023 15:12:57 +0200 |
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231020090731.28701-11-quintela@redhat.com>
---
docs/devel/migration.rst | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst
index be913630c3..240eb16d90 100644
--- a/docs/devel/migration.rst
+++ b/docs/devel/migration.rst
@@ -167,13 +167,17 @@ An example (from hw/input/pckbd.c)
}
};
-We are declaring the state with name "pckbd".
-The ``version_id`` is 3, and the fields are 4 uint8_t in a KBDState structure.
-We registered this with:
+We are declaring the state with name "pckbd". The ``version_id`` is
+3, and there are 4 uint8_t fields in the KBDState structure. We
+registered this ``VMSTATEDescription`` with one of the following
+functions. The first one will generate a device ``instance_id``
+different for each registration. Use the second one if you already
+have an id that is different for each instance of the device:
.. code:: c
- vmstate_register(NULL, 0, &vmstate_kbd, s);
+ vmstate_register_any(NULL, &vmstate_kbd, s);
+ vmstate_register(NULL, instance_id, &vmstate_kbd, s);
For devices that are ``qdev`` based, we can register the device in the class
init function:
--
2.41.0
- [PULL 20/39] hw/s390x/s390-stattrib: Simplify handling of the "migration-enabled" property, (continued)
- [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, 2023/10/24
- [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 <=
- [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
- [PULL 36/39] migration: migrate 'inc' command option is deprecated., Juan Quintela, 2023/10/24
- [PULL 26/39] migration: Use vmstate_register_any(), Juan Quintela, 2023/10/24
- [PULL 37/39] migration: migrate 'blk' command option is deprecated., Juan Quintela, 2023/10/24
- [PULL 38/39] migration: Deprecate block migration, Juan Quintela, 2023/10/24
- [PULL 34/39] migration: Use vmstate_register_any() for vmware_vga, Juan Quintela, 2023/10/24
- [PULL 39/39] migration: Deprecate old compression method, Juan Quintela, 2023/10/24