s390x/MAINTAINERS: add mailing list
[qemu.git] / include / migration / register.h
blobf4f7bdc177b766e4dc528727e65b27d8271769cb
1 /*
2 * QEMU migration vmstate registration
4 * Copyright IBM, Corp. 2008
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
14 #ifndef MIGRATION_REGISTER_H
15 #define MIGRATION_REGISTER_H
17 typedef struct SaveVMHandlers {
18 /* This runs inside the iothread lock. */
19 SaveStateHandler *save_state;
21 void (*save_cleanup)(void *opaque);
22 int (*save_live_complete_postcopy)(QEMUFile *f, void *opaque);
23 int (*save_live_complete_precopy)(QEMUFile *f, void *opaque);
25 /* This runs both outside and inside the iothread lock. */
26 bool (*is_active)(void *opaque);
27 bool (*has_postcopy)(void *opaque);
29 /* This runs outside the iothread lock in the migration case, and
30 * within the lock in the savevm case. The callback had better only
31 * use data that is local to the migration thread or protected
32 * by other locks.
34 int (*save_live_iterate)(QEMUFile *f, void *opaque);
36 /* This runs outside the iothread lock! */
37 int (*save_setup)(QEMUFile *f, void *opaque);
38 void (*save_live_pending)(QEMUFile *f, void *opaque,
39 uint64_t threshold_size,
40 uint64_t *non_postcopiable_pending,
41 uint64_t *postcopiable_pending);
42 LoadStateHandler *load_state;
43 int (*load_setup)(QEMUFile *f, void *opaque);
44 int (*load_cleanup)(void *opaque);
45 } SaveVMHandlers;
47 int register_savevm_live(DeviceState *dev,
48 const char *idstr,
49 int instance_id,
50 int version_id,
51 SaveVMHandlers *ops,
52 void *opaque);
54 void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque);
56 #endif