root / migration.h @ 08c573a8
History | View | Annotate | Download (2.5 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 |
#include "error.h" |
21 |
|
22 |
struct MigrationParams {
|
23 |
bool blk;
|
24 |
bool shared;
|
25 |
}; |
26 |
|
27 |
typedef struct MigrationState MigrationState; |
28 |
|
29 |
struct MigrationState
|
30 |
{ |
31 |
int64_t bandwidth_limit; |
32 |
QEMUFile *file; |
33 |
int fd;
|
34 |
int state;
|
35 |
int (*get_error)(MigrationState *s);
|
36 |
int (*close)(MigrationState *s);
|
37 |
int (*write)(MigrationState *s, const void *buff, size_t size); |
38 |
void *opaque;
|
39 |
MigrationParams params; |
40 |
int64_t total_time; |
41 |
}; |
42 |
|
43 |
void process_incoming_migration(QEMUFile *f);
|
44 |
|
45 |
int qemu_start_incoming_migration(const char *uri, Error **errp); |
46 |
|
47 |
uint64_t migrate_max_downtime(void);
|
48 |
|
49 |
void do_info_migrate_print(Monitor *mon, const QObject *data); |
50 |
|
51 |
void do_info_migrate(Monitor *mon, QObject **ret_data);
|
52 |
|
53 |
int exec_start_incoming_migration(const char *host_port); |
54 |
|
55 |
int exec_start_outgoing_migration(MigrationState *s, const char *host_port); |
56 |
|
57 |
int tcp_start_incoming_migration(const char *host_port, Error **errp); |
58 |
|
59 |
int tcp_start_outgoing_migration(MigrationState *s, const char *host_port, |
60 |
Error **errp); |
61 |
|
62 |
int unix_start_incoming_migration(const char *path); |
63 |
|
64 |
int unix_start_outgoing_migration(MigrationState *s, const char *path); |
65 |
|
66 |
int fd_start_incoming_migration(const char *path); |
67 |
|
68 |
int fd_start_outgoing_migration(MigrationState *s, const char *fdname); |
69 |
|
70 |
void migrate_fd_error(MigrationState *s);
|
71 |
|
72 |
void migrate_fd_connect(MigrationState *s);
|
73 |
|
74 |
void add_migration_state_change_notifier(Notifier *notify);
|
75 |
void remove_migration_state_change_notifier(Notifier *notify);
|
76 |
bool migration_is_active(MigrationState *);
|
77 |
bool migration_has_finished(MigrationState *);
|
78 |
bool migration_has_failed(MigrationState *);
|
79 |
|
80 |
uint64_t ram_bytes_remaining(void);
|
81 |
uint64_t ram_bytes_transferred(void);
|
82 |
uint64_t ram_bytes_total(void);
|
83 |
|
84 |
int ram_save_live(QEMUFile *f, int stage, void *opaque); |
85 |
int ram_load(QEMUFile *f, void *opaque, int version_id); |
86 |
|
87 |
/**
|
88 |
* @migrate_add_blocker - prevent migration from proceeding
|
89 |
*
|
90 |
* @reason - an error to be returned whenever migration is attempted
|
91 |
*/
|
92 |
void migrate_add_blocker(Error *reason);
|
93 |
|
94 |
/**
|
95 |
* @migrate_del_blocker - remove a blocking error from migration
|
96 |
*
|
97 |
* @reason - the error blocking migration
|
98 |
*/
|
99 |
void migrate_del_blocker(Error *reason);
|
100 |
|
101 |
#endif
|