Skip to content

Commit

Permalink
migration: I messed state_pending_exact/estimate
Browse files Browse the repository at this point in the history
I called the helper function from the wrong top level function.

This code was introduced in:

commit c8df4a7
Author: Juan Quintela <quintela@redhat.com>
Date:   Mon Oct 3 02:00:03 2022 +0200

    migration: Split save_live_pending() into state_pending_*

    We split the function into to:

    - state_pending_estimate: We estimate the remaining state size without
      stopping the machine.

    - state pending_exact: We calculate the exact amount of remaining
      state.

Thanks to Avihai Horon <avihaih@nvidia.com> for finding it.

Fixes:c8df4a7aeffcb46020f610526eea621fa5b0cd47

When we introduced that patch, we enden calling

state_pending_estimate() helper from qemu_savevm_statepending_exact()
and
state_pending_exact() helper from qemu_savevm_statepending_estimate()

This patch fixes it.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
  • Loading branch information
Juan Quintela committed Feb 9, 2023
1 parent 777951d commit 2aadffb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions migration/savevm.c
Expand Up @@ -1552,17 +1552,17 @@ void qemu_savevm_state_pending_estimate(uint64_t *res_precopy_only,
*res_postcopy_only = 0;

QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
if (!se->ops || !se->ops->state_pending_exact) {
if (!se->ops || !se->ops->state_pending_estimate) {
continue;
}
if (se->ops->is_active) {
if (!se->ops->is_active(se->opaque)) {
continue;
}
}
se->ops->state_pending_exact(se->opaque,
res_precopy_only, res_compatible,
res_postcopy_only);
se->ops->state_pending_estimate(se->opaque,
res_precopy_only, res_compatible,
res_postcopy_only);
}
}

Expand All @@ -1577,17 +1577,17 @@ void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only,
*res_postcopy_only = 0;

QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
if (!se->ops || !se->ops->state_pending_estimate) {
if (!se->ops || !se->ops->state_pending_exact) {
continue;
}
if (se->ops->is_active) {
if (!se->ops->is_active(se->opaque)) {
continue;
}
}
se->ops->state_pending_estimate(se->opaque,
res_precopy_only, res_compatible,
res_postcopy_only);
se->ops->state_pending_exact(se->opaque,
res_precopy_only, res_compatible,
res_postcopy_only);
}
}

Expand Down

0 comments on commit 2aadffb

Please sign in to comment.