root / migration.h @ 18ebcc86
History | View | Annotate | Download (2.4 kB)
1 |
/*
|
---|---|
2 |
* QEMU live migration
|
3 |
*
|
4 |
* Copyright IBM, Corp. 2008
|
5 |
*
|
6 |
* Authors:
|
7 |
* Anthony Liguori <aliguori@us.ibm.com>
|
8 |
*
|
9 |
* This work is licensed under the terms of the GNU GPL, version 2. See
|
10 |
* the COPYING file in the top-level directory.
|
11 |
*
|
12 |
*/
|
13 |
|
14 |
#ifndef QEMU_MIGRATION_H
|
15 |
#define QEMU_MIGRATION_H
|
16 |
|
17 |
#include "qdict.h" |
18 |
#include "qemu-common.h" |
19 |
#include "notify.h" |
20 |
|
21 |
typedef struct MigrationState MigrationState; |
22 |
|
23 |
struct MigrationState
|
24 |
{ |
25 |
int64_t bandwidth_limit; |
26 |
QEMUFile *file; |
27 |
int fd;
|
28 |
Monitor *mon; |
29 |
int state;
|
30 |
int (*get_error)(MigrationState *s);
|
31 |
int (*close)(MigrationState *s);
|
32 |
int (*write)(MigrationState *s, const void *buff, size_t size); |
33 |
void *opaque;
|
34 |
int blk;
|
35 |
int shared;
|
36 |
}; |
37 |
|
38 |
void process_incoming_migration(QEMUFile *f);
|
39 |
|
40 |
int qemu_start_incoming_migration(const char *uri); |
41 |
|
42 |
int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data); |
43 |
|
44 |
int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data); |
45 |
|
46 |
int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data); |
47 |
|
48 |
uint64_t migrate_max_downtime(void);
|
49 |
|
50 |
int do_migrate_set_downtime(Monitor *mon, const QDict *qdict, |
51 |
QObject **ret_data); |
52 |
|
53 |
void do_info_migrate_print(Monitor *mon, const QObject *data); |
54 |
|
55 |
void do_info_migrate(Monitor *mon, QObject **ret_data);
|
56 |
|
57 |
int exec_start_incoming_migration(const char *host_port); |
58 |
|
59 |
int exec_start_outgoing_migration(MigrationState *s, const char *host_port); |
60 |
|
61 |
int tcp_start_incoming_migration(const char *host_port); |
62 |
|
63 |
int tcp_start_outgoing_migration(MigrationState *s, const char *host_port); |
64 |
|
65 |
int unix_start_incoming_migration(const char *path); |
66 |
|
67 |
int unix_start_outgoing_migration(MigrationState *s, const char *path); |
68 |
|
69 |
int fd_start_incoming_migration(const char *path); |
70 |
|
71 |
int fd_start_outgoing_migration(MigrationState *s, const char *fdname); |
72 |
|
73 |
void migrate_fd_error(MigrationState *s);
|
74 |
|
75 |
void migrate_fd_connect(MigrationState *s);
|
76 |
|
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 *);
|
82 |
|
83 |
uint64_t ram_bytes_remaining(void);
|
84 |
uint64_t ram_bytes_transferred(void);
|
85 |
uint64_t ram_bytes_total(void);
|
86 |
|
87 |
int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque); |
88 |
int ram_load(QEMUFile *f, void *opaque, int version_id); |
89 |
|
90 |
extern int incoming_expected; |
91 |
|
92 |
#endif
|