* [PATCH v2] migration: I messed state_pending_exact/estimate
@ 2023-02-09 15:23 Juan Quintela
2023-02-09 15:27 ` Peter Maydell
2023-02-09 16:46 ` Dr. David Alan Gilbert
0 siblings, 2 replies; 3+ messages in thread
From: Juan Quintela @ 2023-02-09 15:23 UTC (permalink / raw)
To: qemu-devel; +Cc: Juan Quintela, Dr. David Alan Gilbert
I called the helper function from the wrong top level function.
This code was introduced in:
commit c8df4a7aeffcb46020f610526eea621fa5b0cd47
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.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/savevm.c | 50 +++++++++++++++++++++++-----------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/migration/savevm.c b/migration/savevm.c
index e9cf4999ad..ce181e21e1 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1551,31 +1551,6 @@ void qemu_savevm_state_pending_estimate(uint64_t *res_precopy_only,
*res_compatible = 0;
*res_postcopy_only = 0;
- QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
- 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_exact(se->opaque,
- res_precopy_only, res_compatible,
- res_postcopy_only);
- }
-}
-
-void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only,
- uint64_t *res_compatible,
- uint64_t *res_postcopy_only)
-{
- SaveStateEntry *se;
-
- *res_precopy_only = 0;
- *res_compatible = 0;
- *res_postcopy_only = 0;
-
QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
if (!se->ops || !se->ops->state_pending_estimate) {
continue;
@@ -1591,6 +1566,31 @@ void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only,
}
}
+void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only,
+ uint64_t *res_compatible,
+ uint64_t *res_postcopy_only)
+{
+ SaveStateEntry *se;
+
+ *res_precopy_only = 0;
+ *res_compatible = 0;
+ *res_postcopy_only = 0;
+
+ QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
+ 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_exact(se->opaque,
+ res_precopy_only, res_compatible,
+ res_postcopy_only);
+ }
+}
+
void qemu_savevm_state_cleanup(void)
{
SaveStateEntry *se;
--
2.39.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] migration: I messed state_pending_exact/estimate
2023-02-09 15:23 [PATCH v2] migration: I messed state_pending_exact/estimate Juan Quintela
@ 2023-02-09 15:27 ` Peter Maydell
2023-02-09 16:46 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2023-02-09 15:27 UTC (permalink / raw)
To: Juan Quintela; +Cc: qemu-devel, Dr. David Alan Gilbert
On Thu, 9 Feb 2023 at 15:23, Juan Quintela <quintela@redhat.com> wrote:
>
> I called the helper function from the wrong top level function.
>
> This code was introduced in:
>
> commit c8df4a7aeffcb46020f610526eea621fa5b0cd47
> 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.
Given that this commit has already gone out in a
release, it would be useful to describe in the commit
message what the consequences of the bug are, if any.
A Fixes: line would also record the commit being fixed
in a more easily processable way.
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] migration: I messed state_pending_exact/estimate
2023-02-09 15:23 [PATCH v2] migration: I messed state_pending_exact/estimate Juan Quintela
2023-02-09 15:27 ` Peter Maydell
@ 2023-02-09 16:46 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2023-02-09 16:46 UTC (permalink / raw)
To: Juan Quintela; +Cc: qemu-devel
* Juan Quintela (quintela@redhat.com) wrote:
> I called the helper function from the wrong top level function.
Oops yes; as Peter says, this needs a Fixes: line, bu tother than that.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> This code was introduced in:
>
> commit c8df4a7aeffcb46020f610526eea621fa5b0cd47
> 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.
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
> migration/savevm.c | 50 +++++++++++++++++++++++-----------------------
> 1 file changed, 25 insertions(+), 25 deletions(-)
>
> diff --git a/migration/savevm.c b/migration/savevm.c
> index e9cf4999ad..ce181e21e1 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -1551,31 +1551,6 @@ void qemu_savevm_state_pending_estimate(uint64_t *res_precopy_only,
> *res_compatible = 0;
> *res_postcopy_only = 0;
>
> - QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
> - 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_exact(se->opaque,
> - res_precopy_only, res_compatible,
> - res_postcopy_only);
> - }
> -}
> -
> -void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only,
> - uint64_t *res_compatible,
> - uint64_t *res_postcopy_only)
> -{
> - SaveStateEntry *se;
> -
> - *res_precopy_only = 0;
> - *res_compatible = 0;
> - *res_postcopy_only = 0;
> -
> QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
> if (!se->ops || !se->ops->state_pending_estimate) {
> continue;
> @@ -1591,6 +1566,31 @@ void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only,
> }
> }
>
> +void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only,
> + uint64_t *res_compatible,
> + uint64_t *res_postcopy_only)
> +{
> + SaveStateEntry *se;
> +
> + *res_precopy_only = 0;
> + *res_compatible = 0;
> + *res_postcopy_only = 0;
> +
> + QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
> + 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_exact(se->opaque,
> + res_precopy_only, res_compatible,
> + res_postcopy_only);
> + }
> +}
> +
> void qemu_savevm_state_cleanup(void)
> {
> SaveStateEntry *se;
> --
> 2.39.1
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-09 16:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-09 15:23 [PATCH v2] migration: I messed state_pending_exact/estimate Juan Quintela
2023-02-09 15:27 ` Peter Maydell
2023-02-09 16:46 ` Dr. David Alan Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).