aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2023-02-08 14:48:02 +0100
committerJuan Quintela <quintela@redhat.com>2023-02-15 20:04:30 +0100
commit24beea4efe6e6b65fd6248ede936cd3278b2bf8a (patch)
tree99a685728d19d3c8f8ff42f2096b20dcf5faf845 /migration
parent24f254ed794bbd217fbceb6b5840dd4fa6545383 (diff)
downloadqemu-24beea4efe6e6b65fd6248ede936cd3278b2bf8a.zip
qemu-24beea4efe6e6b65fd6248ede936cd3278b2bf8a.tar.gz
qemu-24beea4efe6e6b65fd6248ede936cd3278b2bf8a.tar.bz2
migration: Rename res_{postcopy,precopy}_only
Once that res_compatible is removed, they don't make sense anymore. We remove the _only preffix. And to make things clearer we rename them to must_precopy and can_postcopy. Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/block-dirty-bitmap.c6
-rw-r--r--migration/block.c7
-rw-r--r--migration/migration.c18
-rw-r--r--migration/ram.c18
-rw-r--r--migration/savevm.c24
-rw-r--r--migration/savevm.h8
6 files changed, 37 insertions, 44 deletions
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 9c6655e..fe73aa9 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -763,8 +763,8 @@ static int dirty_bitmap_save_complete(QEMUFile *f, void *opaque)
}
static void dirty_bitmap_state_pending(void *opaque,
- uint64_t *res_precopy_only,
- uint64_t *res_postcopy_only)
+ uint64_t *must_precopy,
+ uint64_t *can_postcopy)
{
DBMSaveState *s = &((DBMState *)opaque)->save;
SaveBitmapState *dbms;
@@ -784,7 +784,7 @@ static void dirty_bitmap_state_pending(void *opaque,
trace_dirty_bitmap_state_pending(pending);
- *res_postcopy_only += pending;
+ *can_postcopy += pending;
}
/* First occurrence of this bitmap. It should be created if doesn't exist */
diff --git a/migration/block.c b/migration/block.c
index 168ef89..426a25b 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -853,9 +853,8 @@ static int block_save_complete(QEMUFile *f, void *opaque)
return 0;
}
-static void block_state_pending(void *opaque,
- uint64_t *res_precopy_only,
- uint64_t *res_postcopy_only)
+static void block_state_pending(void *opaque, uint64_t *must_precopy,
+ uint64_t *can_postcopy)
{
/* Estimate pending number of bytes to send */
uint64_t pending;
@@ -876,7 +875,7 @@ static void block_state_pending(void *opaque,
trace_migration_block_state_pending(pending);
/* We don't do postcopy */
- *res_precopy_only += pending;
+ *must_precopy += pending;
}
static int block_load(QEMUFile *f, void *opaque, int version_id)
diff --git a/migration/migration.c b/migration/migration.c
index 296f7fe..ae2025d 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3863,18 +3863,18 @@ typedef enum {
*/
static MigIterateState migration_iteration_run(MigrationState *s)
{
- uint64_t pend_pre, 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_post);
- uint64_t pending_size = pend_pre + 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_post);
+ trace_migrate_pending_estimate(pending_size, must_precopy, can_postcopy);
- if (pend_pre <= s->threshold_size) {
- qemu_savevm_state_pending_exact(&pend_pre, &pend_post);
- pending_size = pend_pre + pend_post;
- trace_migrate_pending_exact(pending_size, pend_pre, 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) {
@@ -3884,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__);
diff --git a/migration/ram.c b/migration/ram.c
index 178f92a..96e8a19 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3489,9 +3489,8 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
return 0;
}
-static void ram_state_pending_estimate(void *opaque,
- uint64_t *res_precopy_only,
- uint64_t *res_postcopy_only)
+static void ram_state_pending_estimate(void *opaque, uint64_t *must_precopy,
+ uint64_t *can_postcopy)
{
RAMState **temp = opaque;
RAMState *rs = *temp;
@@ -3500,15 +3499,14 @@ static void ram_state_pending_estimate(void *opaque,
if (migrate_postcopy_ram()) {
/* We can do postcopy, and all the data is postcopiable */
- *res_postcopy_only += remaining_size;
+ *can_postcopy += remaining_size;
} else {
- *res_precopy_only += remaining_size;
+ *must_precopy += remaining_size;
}
}
-static void ram_state_pending_exact(void *opaque,
- uint64_t *res_precopy_only,
- uint64_t *res_postcopy_only)
+static void ram_state_pending_exact(void *opaque, uint64_t *must_precopy,
+ uint64_t *can_postcopy)
{
RAMState **temp = opaque;
RAMState *rs = *temp;
@@ -3526,9 +3524,9 @@ static void ram_state_pending_exact(void *opaque,
if (migrate_postcopy_ram()) {
/* We can do postcopy, and all the data is postcopiable */
- *res_postcopy_only += remaining_size;
+ *can_postcopy += remaining_size;
} else {
- *res_precopy_only += remaining_size;
+ *must_precopy += remaining_size;
}
}
diff --git a/migration/savevm.c b/migration/savevm.c
index 80b7f12..aa54a67 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1541,13 +1541,13 @@ flush:
* the result is split into the amount for units that can and
* for units that can't do postcopy.
*/
-void qemu_savevm_state_pending_estimate(uint64_t *res_precopy_only,
- uint64_t *res_postcopy_only)
+void qemu_savevm_state_pending_estimate(uint64_t *must_precopy,
+ uint64_t *can_postcopy)
{
SaveStateEntry *se;
- *res_precopy_only = 0;
- *res_postcopy_only = 0;
+ *must_precopy = 0;
+ *can_postcopy = 0;
QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
if (!se->ops || !se->ops->state_pending_estimate) {
@@ -1558,19 +1558,17 @@ void qemu_savevm_state_pending_estimate(uint64_t *res_precopy_only,
continue;
}
}
- se->ops->state_pending_estimate(se->opaque,
- res_precopy_only,
- res_postcopy_only);
+ se->ops->state_pending_estimate(se->opaque, must_precopy, can_postcopy);
}
}
-void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only,
- uint64_t *res_postcopy_only)
+void qemu_savevm_state_pending_exact(uint64_t *must_precopy,
+ uint64_t *can_postcopy)
{
SaveStateEntry *se;
- *res_precopy_only = 0;
- *res_postcopy_only = 0;
+ *must_precopy = 0;
+ *can_postcopy = 0;
QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
if (!se->ops || !se->ops->state_pending_exact) {
@@ -1581,9 +1579,7 @@ void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only,
continue;
}
}
- se->ops->state_pending_exact(se->opaque,
- res_precopy_only,
- res_postcopy_only);
+ se->ops->state_pending_exact(se->opaque, must_precopy, can_postcopy);
}
}
diff --git a/migration/savevm.h b/migration/savevm.h
index bd625a6..fb63673 100644
--- a/migration/savevm.h
+++ b/migration/savevm.h
@@ -40,10 +40,10 @@ void qemu_savevm_state_cleanup(void);
void qemu_savevm_state_complete_postcopy(QEMUFile *f);
int qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only,
bool inactivate_disks);
-void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only,
- uint64_t *res_postcopy_only);
-void qemu_savevm_state_pending_estimate(uint64_t *res_precopy_only,
- uint64_t *res_postcopy_only);
+void qemu_savevm_state_pending_exact(uint64_t *must_precopy,
+ uint64_t *can_postcopy);
+void qemu_savevm_state_pending_estimate(uint64_t *must_precopy,
+ uint64_t *can_postcopy);
void qemu_savevm_send_ping(QEMUFile *f, uint32_t value);
void qemu_savevm_send_open_return_path(QEMUFile *f);
int qemu_savevm_send_packaged(QEMUFile *f, const uint8_t *buf, size_t len);