aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMaciej S. Szmigiero <maciej.szmigiero@oracle.com>2025-03-04 23:03:36 +0100
committerCédric Le Goater <clg@redhat.com>2025-03-06 06:47:33 +0100
commitb1937fd1eb8360d0dc0abb0a8da221d8edce3733 (patch)
tree743f2575705e15fa3bee4b21e8b123f41dae99f7 /include
parent18eb55546a54e443d94a4c49286348176ad4b00a (diff)
downloadqemu-b1937fd1eb8360d0dc0abb0a8da221d8edce3733.zip
qemu-b1937fd1eb8360d0dc0abb0a8da221d8edce3733.tar.gz
qemu-b1937fd1eb8360d0dc0abb0a8da221d8edce3733.tar.bz2
migration: Add thread pool of optional load threads
Some drivers might want to make use of auxiliary helper threads during VM state loading, for example to make sure that their blocking (sync) I/O operations don't block the rest of the migration process. Add a migration core managed thread pool to facilitate this use case. The migration core will wait for these threads to finish before (re)starting the VM at destination. Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> Link: https://lore.kernel.org/qemu-devel/b09fd70369b6159c75847e69f235cb908b02570c.1741124640.git.maciej.szmigiero@oracle.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/migration/misc.h3
-rw-r--r--include/qemu/typedefs.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/include/migration/misc.h b/include/migration/misc.h
index c660be8..4c171f4 100644
--- a/include/migration/misc.h
+++ b/include/migration/misc.h
@@ -45,9 +45,12 @@ bool migrate_ram_is_ignored(RAMBlock *block);
/* migration/block.c */
AnnounceParameters *migrate_announce_params(void);
+
/* migration/savevm.c */
void dump_vmstate_json_to_file(FILE *out_fp);
+void qemu_loadvm_start_load_thread(MigrationLoadThread function,
+ void *opaque);
/* migration/migration.c */
void migration_object_init(void);
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 3d84efc..fd23ff7 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -131,5 +131,7 @@ typedef struct IRQState *qemu_irq;
* Function types
*/
typedef void (*qemu_irq_handler)(void *opaque, int n, int level);
+typedef bool (*MigrationLoadThread)(void *opaque, bool *should_quit,
+ Error **errp);
#endif /* QEMU_TYPEDEFS_H */