diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2024-10-03 15:34:01 +0100 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2024-10-04 18:54:55 +0300 |
commit | e300f4c11dae9be4cc2f44837fe6e560576cc27f (patch) | |
tree | 569a1fb7bfb7d8b11caa45633c6f5c87a4b182b6 /docs | |
parent | db17daf8c43a321f62f8bc46ea0f4a76e16b386f (diff) | |
download | qemu-e300f4c11dae9be4cc2f44837fe6e560576cc27f.zip qemu-e300f4c11dae9be4cc2f44837fe6e560576cc27f.tar.gz qemu-e300f4c11dae9be4cc2f44837fe6e560576cc27f.tar.bz2 |
docs/devel: Mention post_load hook restrictions where we document the hook
Accessing another device in a post_load hook is a bad idea, because
the order of device save/restore is not fixed, and so this
cross-device access makes the save/restore non-deterministic.
We previously only flagged up this requirement in the
record-and-replay developer docs; repeat it in the main migration
documentation, where a developer trying to implement a post_load hook
is more likely to see it.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/devel/migration/main.rst | 6 | ||||
-rw-r--r-- | docs/devel/replay.rst | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/docs/devel/migration/main.rst b/docs/devel/migration/main.rst index 784c899..c2857fc 100644 --- a/docs/devel/migration/main.rst +++ b/docs/devel/migration/main.rst @@ -465,6 +465,12 @@ Examples of such API functions are: - portio_list_set_address() - portio_list_set_enabled() +Since the order of device save/restore is not defined, you must +avoid accessing or changing any other device's state in one of these +callbacks. (For instance, don't do anything that calls ``update_irq()`` +in a ``post_load`` hook.) Otherwise, restore will not be deterministic, +and this will break execution record/replay. + Iterative device migration -------------------------- diff --git a/docs/devel/replay.rst b/docs/devel/replay.rst index effd856..40f58d9 100644 --- a/docs/devel/replay.rst +++ b/docs/devel/replay.rst @@ -202,6 +202,9 @@ into the log. Saving/restoring the VM state ----------------------------- +Record/replay relies on VM state save and restore being complete and +deterministic. + All fields in the device state structure (including virtual timers) should be restored by loadvm to the same values they had before savevm. |