[PATCH 08/10] migration/colo: Use the RAM iterable helper directly

Peter Xu posted 10 patches 3 days, 11 hours ago
Maintainers: Hailiang Zhang <zhanghailiang@xfusion.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Markus Armbruster <armbru@redhat.com>
[PATCH 08/10] migration/colo: Use the RAM iterable helper directly
Posted by Peter Xu 3 days, 11 hours ago
qemu_savevm_state_complete_precopy() has a weird parameter called
"iterable_only".  It's needed because COLO saves device states in advance.

To make dropping that weird parameter easier, let COLO directly use the RAM
iterator helper instead, which should make the code easier to read too.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 migration/colo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/colo.c b/migration/colo.c
index c344943173..f92803dd29 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -469,7 +469,7 @@ static int colo_do_checkpoint_transaction(MigrationState *s,
      * TODO: We may need a timeout mechanism to prevent COLO process
      * to be blocked here.
      */
-    qemu_savevm_state_complete_precopy(s->to_dst_file, true);
+    qemu_savevm_state_complete_precopy_iterable(s->to_dst_file, false);
     qemu_put_byte(s->to_dst_file, QEMU_VM_EOF);
 
     qemu_fflush(fb);
-- 
2.50.1
Re: [PATCH 08/10] migration/colo: Use the RAM iterable helper directly
Posted by Fabiano Rosas 1 day, 20 hours ago
Peter Xu <peterx@redhat.com> writes:

> qemu_savevm_state_complete_precopy() has a weird parameter called
> "iterable_only".  It's needed because COLO saves device states in advance.
>
> To make dropping that weird parameter easier, let COLO directly use the RAM
> iterator helper instead, which should make the code easier to read too.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  migration/colo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/migration/colo.c b/migration/colo.c
> index c344943173..f92803dd29 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -469,7 +469,7 @@ static int colo_do_checkpoint_transaction(MigrationState *s,
>       * TODO: We may need a timeout mechanism to prevent COLO process
>       * to be blocked here.
>       */
> -    qemu_savevm_state_complete_precopy(s->to_dst_file, true);
> +    qemu_savevm_state_complete_precopy_iterable(s->to_dst_file, false);
>      qemu_put_byte(s->to_dst_file, QEMU_VM_EOF);
>  
>      qemu_fflush(fb);

Reviewed-by: Fabiano Rosas <farosas@suse.de>