target-microblaze: dec_barrel: Plug TCG temp leak
[qemu/ar7.git] / include / migration / register.h
blobd9498d95eb0b86fce43c9a38d16137a0571a3197
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 (*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);
28 /* This runs outside the iothread lock in the migration case, and
29 * within the lock in the savevm case. The callback had better only
30 * use data that is local to the migration thread or protected
31 * by other locks.
33 int (*save_live_iterate)(QEMUFile *f, void *opaque);
35 /* This runs outside the iothread lock! */
36 int (*save_live_setup)(QEMUFile *f, void *opaque);
37 void (*save_live_pending)(QEMUFile *f, void *opaque,
38 uint64_t threshold_size,
39 uint64_t *non_postcopiable_pending,
40 uint64_t *postcopiable_pending);
41 LoadStateHandler *load_state;
42 } SaveVMHandlers;
44 int register_savevm_live(DeviceState *dev,
45 const char *idstr,
46 int instance_id,
47 int version_id,
48 SaveVMHandlers *ops,
49 void *opaque);
51 void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque);
53 #endif