4 * Copyright IBM, Corp. 2008
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 QEMU_MIGRATION_H
15 #define QEMU_MIGRATION_H
18 #include "qemu-common.h"
22 typedef struct MigrationState MigrationState
;
26 int64_t bandwidth_limit
;
30 int (*get_error
)(MigrationState
*s
);
31 int (*close
)(MigrationState
*s
);
32 int (*write
)(MigrationState
*s
, const void *buff
, size_t size
);
38 void process_incoming_migration(QEMUFile
*f
);
40 int qemu_start_incoming_migration(const char *uri
, Error
**errp
);
42 uint64_t migrate_max_downtime(void);
44 void do_info_migrate_print(Monitor
*mon
, const QObject
*data
);
46 void do_info_migrate(Monitor
*mon
, QObject
**ret_data
);
48 int exec_start_incoming_migration(const char *host_port
);
50 int exec_start_outgoing_migration(MigrationState
*s
, const char *host_port
);
52 int tcp_start_incoming_migration(const char *host_port
, Error
**errp
);
54 int tcp_start_outgoing_migration(MigrationState
*s
, const char *host_port
,
57 int unix_start_incoming_migration(const char *path
);
59 int unix_start_outgoing_migration(MigrationState
*s
, const char *path
);
61 int fd_start_incoming_migration(const char *path
);
63 int fd_start_outgoing_migration(MigrationState
*s
, const char *fdname
);
65 void migrate_fd_error(MigrationState
*s
);
67 void migrate_fd_connect(MigrationState
*s
);
69 void add_migration_state_change_notifier(Notifier
*notify
);
70 void remove_migration_state_change_notifier(Notifier
*notify
);
71 bool migration_is_active(MigrationState
*);
72 bool migration_has_finished(MigrationState
*);
73 bool migration_has_failed(MigrationState
*);
75 uint64_t ram_bytes_remaining(void);
76 uint64_t ram_bytes_transferred(void);
77 uint64_t ram_bytes_total(void);
79 int ram_save_live(QEMUFile
*f
, int stage
, void *opaque
);
80 int ram_load(QEMUFile
*f
, void *opaque
, int version_id
);
83 * @migrate_add_blocker - prevent migration from proceeding
85 * @reason - an error to be returned whenever migration is attempted
87 void migrate_add_blocker(Error
*reason
);
90 * @migrate_del_blocker - remove a blocking error from migration
92 * @reason - the error blocking migration
94 void migrate_del_blocker(Error
*reason
);