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"
21 typedef struct MigrationState MigrationState
;
25 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
);
42 int do_migrate(Monitor
*mon
, const QDict
*qdict
, QObject
**ret_data
);
44 int do_migrate_cancel(Monitor
*mon
, const QDict
*qdict
, QObject
**ret_data
);
46 int do_migrate_set_speed(Monitor
*mon
, const QDict
*qdict
, QObject
**ret_data
);
48 uint64_t migrate_max_downtime(void);
50 int do_migrate_set_downtime(Monitor
*mon
, const QDict
*qdict
,
53 void do_info_migrate_print(Monitor
*mon
, const QObject
*data
);
55 void do_info_migrate(Monitor
*mon
, QObject
**ret_data
);
57 int exec_start_incoming_migration(const char *host_port
);
59 int exec_start_outgoing_migration(MigrationState
*s
, const char *host_port
);
61 int tcp_start_incoming_migration(const char *host_port
);
63 int tcp_start_outgoing_migration(MigrationState
*s
, const char *host_port
);
65 int unix_start_incoming_migration(const char *path
);
67 int unix_start_outgoing_migration(MigrationState
*s
, const char *path
);
69 int fd_start_incoming_migration(const char *path
);
71 int fd_start_outgoing_migration(MigrationState
*s
, const char *fdname
);
73 void migrate_fd_error(MigrationState
*s
);
75 void migrate_fd_connect(MigrationState
*s
);
77 void add_migration_state_change_notifier(Notifier
*notify
);
78 void remove_migration_state_change_notifier(Notifier
*notify
);
79 bool migration_is_active(MigrationState
*);
80 bool migration_has_finished(MigrationState
*);
81 bool migration_has_failed(MigrationState
*);
83 uint64_t ram_bytes_remaining(void);
84 uint64_t ram_bytes_transferred(void);
85 uint64_t ram_bytes_total(void);
87 int ram_save_live(Monitor
*mon
, QEMUFile
*f
, int stage
, void *opaque
);
88 int ram_load(QEMUFile
*f
, void *opaque
, int version_id
);
90 extern int incoming_expected
;