xref: /qemu/include/migration/cpr.h (revision 513823e7521a09ed7ad1e32e6454bac3b2cbf52d)
1 /*
2  * Copyright (c) 2021, 2024 Oracle and/or its affiliates.
3  *
4  * This work is licensed under the terms of the GNU GPL, version 2 or later.
5  * See the COPYING file in the top-level directory.
6  */
7 
8 #ifndef MIGRATION_CPR_H
9 #define MIGRATION_CPR_H
10 
11 #include "qapi/qapi-types-migration.h"
12 
13 #define MIG_MODE_NONE           -1
14 
15 #define QEMU_CPR_FILE_MAGIC     0x51435052
16 #define QEMU_CPR_FILE_VERSION   0x00000001
17 
18 void cpr_save_fd(const char *name, int id, int fd);
19 void cpr_delete_fd(const char *name, int id);
20 int cpr_find_fd(const char *name, int id);
21 
22 MigMode cpr_get_incoming_mode(void);
23 void cpr_set_incoming_mode(MigMode mode);
24 
25 int cpr_state_save(MigrationChannel *channel, Error **errp);
26 int cpr_state_load(MigrationChannel *channel, Error **errp);
27 void cpr_state_close(void);
28 struct QIOChannel *cpr_state_ioc(void);
29 
30 QEMUFile *cpr_transfer_output(MigrationChannel *channel, Error **errp);
31 QEMUFile *cpr_transfer_input(MigrationChannel *channel, Error **errp);
32 
33 #endif
34