[PATCH 02/10] migration: Use qemu_savevm_send_header() in qemu_save_device_state()

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 02/10] migration: Use qemu_savevm_send_header() in qemu_save_device_state()
Posted by Peter Xu 3 days, 11 hours ago
Reduces duplication of the other path where we also send the same header.

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

diff --git a/migration/savevm.c b/migration/savevm.c
index e26656cca3..64bf445c98 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1872,8 +1872,7 @@ int qemu_save_device_state(QEMUFile *f)
     SaveStateEntry *se;
 
     if (!migration_in_colo_state()) {
-        qemu_put_be32(f, QEMU_VM_FILE_MAGIC);
-        qemu_put_be32(f, QEMU_VM_FILE_VERSION);
+        qemu_savevm_send_header(f);
     }
     cpu_synchronize_all_states();
 
-- 
2.50.1
Re: [PATCH 02/10] migration: Use qemu_savevm_send_header() in qemu_save_device_state()
Posted by Fabiano Rosas 1 day, 20 hours ago
Peter Xu <peterx@redhat.com> writes:

> Reduces duplication of the other path where we also send the same header.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  migration/savevm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/migration/savevm.c b/migration/savevm.c
> index e26656cca3..64bf445c98 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -1872,8 +1872,7 @@ int qemu_save_device_state(QEMUFile *f)
>      SaveStateEntry *se;
>  
>      if (!migration_in_colo_state()) {
> -        qemu_put_be32(f, QEMU_VM_FILE_MAGIC);
> -        qemu_put_be32(f, QEMU_VM_FILE_VERSION);
> +        qemu_savevm_send_header(f);
>      }
>      cpu_synchronize_all_states();

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