summary refs log tree commit diff stats
path: root/migration/migration.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2023-02-16 13:09:51 +0000
committerPeter Maydell <peter.maydell@linaro.org>2023-02-16 13:09:51 +0000
commit6dffbe36af79e26a4d23f94a9a1c1201de99c261 (patch)
treefaf6a88f7db02294f91c1aa717cf35cce2e06218 /migration/migration.c
parent003ba52a8b327180e284630b289c6ece5a3e08b9 (diff)
parent24beea4efe6e6b65fd6248ede936cd3278b2bf8a (diff)
downloadfocaccia-qemu-6dffbe36af79e26a4d23f94a9a1c1201de99c261.tar.gz
focaccia-qemu-6dffbe36af79e26a4d23f94a9a1c1201de99c261.zip
Merge tag 'migration-20230215-pull-request' of https://gitlab.com/juan.quintela/qemu into staging
Migration Pull request

This pull request contains:

* Add qemu_file_get_to_fd() a.k.a. make vfio happy(Avihai)
* migration/block is now DPRINTF() free zone (Philippe)
* remove res_compat and improve docs (me)

Please apply.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmPtOxgACgkQ9IfvGFhy
# 1yM+8w/+Nrm40o8B+0M1X/2O8SPaXE0Oxll5qk5AgfC+2Ef/n5661ZzOM1xQcqzv
# CN3bj3g7dKN05nGhqW5ZFrEZliJCGksx2FBKMq9H6R5YBSMo/+GHT4ugPqsujudl
# RBafIHzp4h4nTh/4aJ4Kr2Vn/bVQzGVyv5c6yUdUhKhE1QfCLu9AMC5vN1hfWxBz
# IQBvMkLNXXhWOTdkVAElVlFOM6GZzWb1UYDkBaQHjjw/dN0MdCFFj7tIaBIyU2Eb
# KyQCoYeJjjWrljsrfzfCucrW+mbVGmCe1TiCEnaAmmgzOI0NwARmUcdYdCyZ4Nhh
# flNjpqQB6H4/ekI0mus2YPMPEkHyVgBMuF8fHV3YDwxcQ25U39RLymVfAoKPNg88
# S1EcQ9h2QVqdML7bR9vTmPOZKk5vD25H7B8LQIJpT8PHVg3ZzzRaOIR8UHmmFXx/
# PSL1rGfPcCLJ3P1XlVjwBApebMHyid9c+Sohda9L9HPer0jlB+mGQUEV8J67DJiT
# xlffFgJmYu3+AJu9BoqrG0AUW6zA78jSs4Tbp78qbIVA4uzGkWI9JvROMfG9Qcc7
# vruuL0sUXHVUhzW2F+0M+b1rVhaHHQYvFo3mIqdHrd5mGicdgh1HUbaJuEJxeJnh
# oFt6SZbIx3N/pllcvMsxQa+rFI/po+FEkRwIF02SzTRWYHB0qos=
# =KpKO
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 15 Feb 2023 20:05:44 GMT
# gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full]
# gpg:                 aka "Juan Quintela <quintela@trasno.org>" [full]
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* tag 'migration-20230215-pull-request' of https://gitlab.com/juan.quintela/qemu:
  migration: Rename res_{postcopy,precopy}_only
  migration: Remove unused res_compatible
  migration: In case of postcopy, the memory ends in res_postcopy_only
  migration/block: Convert remaining DPRINTF() debug macro to trace events
  migration/qemu-file: Add qemu_file_get_to_fd()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 90fca70cb7..ae2025d9d8 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3863,20 +3863,18 @@ typedef enum {
  */
 static MigIterateState migration_iteration_run(MigrationState *s)
 {
-    uint64_t pend_pre, pend_compat, pend_post;
+    uint64_t must_precopy, can_postcopy;
     bool in_postcopy = s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE;
 
-    qemu_savevm_state_pending_estimate(&pend_pre, &pend_compat, &pend_post);
-    uint64_t pending_size = pend_pre + pend_compat + pend_post;
+    qemu_savevm_state_pending_estimate(&must_precopy, &can_postcopy);
+    uint64_t pending_size = must_precopy + can_postcopy;
 
-    trace_migrate_pending_estimate(pending_size,
-                                   pend_pre, pend_compat, pend_post);
+    trace_migrate_pending_estimate(pending_size, must_precopy, can_postcopy);
 
-    if (pend_pre + pend_compat <= s->threshold_size) {
-        qemu_savevm_state_pending_exact(&pend_pre, &pend_compat, &pend_post);
-        pending_size = pend_pre + pend_compat + pend_post;
-        trace_migrate_pending_exact(pending_size,
-                                    pend_pre, pend_compat, pend_post);
+    if (must_precopy <= s->threshold_size) {
+        qemu_savevm_state_pending_exact(&must_precopy, &can_postcopy);
+        pending_size = must_precopy + can_postcopy;
+        trace_migrate_pending_exact(pending_size, must_precopy, can_postcopy);
     }
 
     if (!pending_size || pending_size < s->threshold_size) {
@@ -3886,7 +3884,7 @@ static MigIterateState migration_iteration_run(MigrationState *s)
     }
 
     /* Still a significant amount to transfer */
-    if (!in_postcopy && pend_pre <= s->threshold_size &&
+    if (!in_postcopy && must_precopy <= s->threshold_size &&
         qatomic_read(&s->start_postcopy)) {
         if (postcopy_start(s)) {
             error_report("%s: postcopy failed to start", __func__);