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