summary refs log tree commit diff stats
path: root/migration/savevm.h
diff options
context:
space:
mode:
authorCédric Le Goater <clg@redhat.com>2024-03-20 07:49:02 +0100
committerPeter Xu <peterx@redhat.com>2024-04-23 18:36:01 -0400
commit057a20099b62c5ac3c925f3fe12bdedac96e647b (patch)
tree32d310788cdc8dbdb90b9c9437ce2c1e2ad8de65 /migration/savevm.h
parent6138d43ab2b1d013ebe2cfe2917e6279396473b2 (diff)
downloadfocaccia-qemu-057a20099b62c5ac3c925f3fe12bdedac96e647b.tar.gz
focaccia-qemu-057a20099b62c5ac3c925f3fe12bdedac96e647b.zip
migration: Add Error** argument to qemu_savevm_state_setup()
This prepares ground for the changes coming next which add an Error**
argument to the .save_setup() handler. Callers of qemu_savevm_state_setup()
now handle the error and fail earlier setting the migration state from
MIGRATION_STATUS_SETUP to MIGRATION_STATUS_FAILED.

In qemu_savevm_state(), move the cleanup to preserve the error
reported by .save_setup() handlers.

Since the previous behavior was to ignore errors at this step of
migration, this change should be examined closely to check that
cleanups are still correctly done.

Signed-off-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/20240320064911.545001-7-clg@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/savevm.h')
-rw-r--r--migration/savevm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/migration/savevm.h b/migration/savevm.h
index 74669733dd..9ec96a995c 100644
--- a/migration/savevm.h
+++ b/migration/savevm.h
@@ -32,7 +32,7 @@
 bool qemu_savevm_state_blocked(Error **errp);
 void qemu_savevm_non_migratable_list(strList **reasons);
 int qemu_savevm_state_prepare(Error **errp);
-void qemu_savevm_state_setup(QEMUFile *f);
+int qemu_savevm_state_setup(QEMUFile *f, Error **errp);
 bool qemu_savevm_state_guest_unplug_pending(void);
 int qemu_savevm_state_resume_prepare(MigrationState *s);
 void qemu_savevm_state_header(QEMUFile *f);