xref: /qemu/include/migration/cpr.h (revision aa90f1161bb17a4863e16ec2f75104cff0752d4e)
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 bool cpr_is_incoming(void);
25 
26 int cpr_state_save(MigrationChannel *channel, Error **errp);
27 int cpr_state_load(MigrationChannel *channel, Error **errp);
28 void cpr_state_close(void);
29 struct QIOChannel *cpr_state_ioc(void);
30 
31 QEMUFile *cpr_transfer_output(MigrationChannel *channel, Error **errp);
32 QEMUFile *cpr_transfer_input(MigrationChannel *channel, Error **errp);
33 
34 #endif
35