root / migration.h @ dd4239d6
History | View | Annotate | Download (3.1 kB)
1 | 5bb7910a | aliguori | /*
|
---|---|---|---|
2 | 5bb7910a | aliguori | * QEMU live migration
|
3 | 5bb7910a | aliguori | *
|
4 | 5bb7910a | aliguori | * Copyright IBM, Corp. 2008
|
5 | 5bb7910a | aliguori | *
|
6 | 5bb7910a | aliguori | * Authors:
|
7 | 5bb7910a | aliguori | * Anthony Liguori <aliguori@us.ibm.com>
|
8 | 5bb7910a | aliguori | *
|
9 | 5bb7910a | aliguori | * This work is licensed under the terms of the GNU GPL, version 2. See
|
10 | 5bb7910a | aliguori | * the COPYING file in the top-level directory.
|
11 | 5bb7910a | aliguori | *
|
12 | 5bb7910a | aliguori | */
|
13 | 5bb7910a | aliguori | |
14 | 5bb7910a | aliguori | #ifndef QEMU_MIGRATION_H
|
15 | 5bb7910a | aliguori | #define QEMU_MIGRATION_H
|
16 | 5bb7910a | aliguori | |
17 | f96fc8a0 | Luiz Capitulino | #include "qdict.h" |
18 | 376253ec | aliguori | #include "qemu-common.h" |
19 | 376253ec | aliguori | |
20 | 5bb7910a | aliguori | #define MIG_STATE_ERROR -1 |
21 | 5bb7910a | aliguori | #define MIG_STATE_COMPLETED 0 |
22 | 5bb7910a | aliguori | #define MIG_STATE_CANCELLED 1 |
23 | 5bb7910a | aliguori | #define MIG_STATE_ACTIVE 2 |
24 | 5bb7910a | aliguori | |
25 | 5bb7910a | aliguori | typedef struct MigrationState MigrationState; |
26 | 5bb7910a | aliguori | |
27 | 5bb7910a | aliguori | struct MigrationState
|
28 | 5bb7910a | aliguori | { |
29 | 5bb7910a | aliguori | /* FIXME: add more accessors to print migration info */
|
30 | 5bb7910a | aliguori | void (*cancel)(MigrationState *s);
|
31 | 5bb7910a | aliguori | int (*get_status)(MigrationState *s);
|
32 | 5bb7910a | aliguori | void (*release)(MigrationState *s);
|
33 | c163b5ca | lirans@il.ibm.com | int blk;
|
34 | c163b5ca | lirans@il.ibm.com | int shared;
|
35 | 5bb7910a | aliguori | }; |
36 | 5bb7910a | aliguori | |
37 | 065e2813 | aliguori | typedef struct FdMigrationState FdMigrationState; |
38 | 065e2813 | aliguori | |
39 | 065e2813 | aliguori | struct FdMigrationState
|
40 | 065e2813 | aliguori | { |
41 | 065e2813 | aliguori | MigrationState mig_state; |
42 | 065e2813 | aliguori | int64_t bandwidth_limit; |
43 | 065e2813 | aliguori | QEMUFile *file; |
44 | 065e2813 | aliguori | int fd;
|
45 | 731b0364 | aliguori | Monitor *mon_resume; |
46 | 065e2813 | aliguori | int state;
|
47 | 065e2813 | aliguori | int (*get_error)(struct FdMigrationState*); |
48 | 065e2813 | aliguori | int (*close)(struct FdMigrationState*); |
49 | 065e2813 | aliguori | int (*write)(struct FdMigrationState*, const void *, size_t); |
50 | 065e2813 | aliguori | void *opaque;
|
51 | 065e2813 | aliguori | }; |
52 | 065e2813 | aliguori | |
53 | 5bb7910a | aliguori | void qemu_start_incoming_migration(const char *uri); |
54 | 5bb7910a | aliguori | |
55 | 5f79da00 | Luiz Capitulino | void do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data); |
56 | 5bb7910a | aliguori | |
57 | 911d2963 | Luiz Capitulino | void do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data); |
58 | 5bb7910a | aliguori | |
59 | 3a492104 | Luiz Capitulino | void do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data); |
60 | 5bb7910a | aliguori | |
61 | a0a3fd60 | Glauber Costa | uint64_t migrate_max_downtime(void);
|
62 | a0a3fd60 | Glauber Costa | |
63 | d54908a5 | Luiz Capitulino | void do_migrate_set_downtime(Monitor *mon, const QDict *qdict); |
64 | 2ea42952 | Glauber Costa | |
65 | 376253ec | aliguori | void do_info_migrate(Monitor *mon);
|
66 | 5bb7910a | aliguori | |
67 | 065e2813 | aliguori | int exec_start_incoming_migration(const char *host_port); |
68 | 065e2813 | aliguori | |
69 | 065e2813 | aliguori | MigrationState *exec_start_outgoing_migration(const char *host_port, |
70 | c163b5ca | lirans@il.ibm.com | int64_t bandwidth_limit, |
71 | c163b5ca | lirans@il.ibm.com | int detach,
|
72 | c163b5ca | lirans@il.ibm.com | int blk,
|
73 | c163b5ca | lirans@il.ibm.com | int inc);
|
74 | 065e2813 | aliguori | |
75 | 34c9dd8e | aliguori | int tcp_start_incoming_migration(const char *host_port); |
76 | 34c9dd8e | aliguori | |
77 | 34c9dd8e | aliguori | MigrationState *tcp_start_outgoing_migration(const char *host_port, |
78 | 34c9dd8e | aliguori | int64_t bandwidth_limit, |
79 | c163b5ca | lirans@il.ibm.com | int detach,
|
80 | c163b5ca | lirans@il.ibm.com | int blk,
|
81 | c163b5ca | lirans@il.ibm.com | int inc);
|
82 | 34c9dd8e | aliguori | |
83 | 4951f65b | Chris Lalancette | int unix_start_incoming_migration(const char *path); |
84 | 4951f65b | Chris Lalancette | |
85 | 4951f65b | Chris Lalancette | MigrationState *unix_start_outgoing_migration(const char *path, |
86 | 4951f65b | Chris Lalancette | int64_t bandwidth_limit, |
87 | c163b5ca | lirans@il.ibm.com | int detach,
|
88 | c163b5ca | lirans@il.ibm.com | int blk,
|
89 | c163b5ca | lirans@il.ibm.com | int inc);
|
90 | 4951f65b | Chris Lalancette | |
91 | 5ac1fad3 | Paolo Bonzini | int fd_start_incoming_migration(const char *path); |
92 | 5ac1fad3 | Paolo Bonzini | |
93 | 5ac1fad3 | Paolo Bonzini | MigrationState *fd_start_outgoing_migration(Monitor *mon, |
94 | 5ac1fad3 | Paolo Bonzini | const char *fdname, |
95 | 5ac1fad3 | Paolo Bonzini | int64_t bandwidth_limit, |
96 | c163b5ca | lirans@il.ibm.com | int detach,
|
97 | c163b5ca | lirans@il.ibm.com | int blk,
|
98 | c163b5ca | lirans@il.ibm.com | int inc);
|
99 | 5ac1fad3 | Paolo Bonzini | |
100 | 731b0364 | aliguori | void migrate_fd_monitor_suspend(FdMigrationState *s);
|
101 | 731b0364 | aliguori | |
102 | 065e2813 | aliguori | void migrate_fd_error(FdMigrationState *s);
|
103 | 065e2813 | aliguori | |
104 | 065e2813 | aliguori | void migrate_fd_cleanup(FdMigrationState *s);
|
105 | 065e2813 | aliguori | |
106 | 065e2813 | aliguori | void migrate_fd_put_notify(void *opaque); |
107 | 065e2813 | aliguori | |
108 | 065e2813 | aliguori | ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size); |
109 | 065e2813 | aliguori | |
110 | 065e2813 | aliguori | void migrate_fd_connect(FdMigrationState *s);
|
111 | 065e2813 | aliguori | |
112 | 065e2813 | aliguori | void migrate_fd_put_ready(void *opaque); |
113 | 065e2813 | aliguori | |
114 | 065e2813 | aliguori | int migrate_fd_get_status(MigrationState *mig_state);
|
115 | 065e2813 | aliguori | |
116 | 065e2813 | aliguori | void migrate_fd_cancel(MigrationState *mig_state);
|
117 | 065e2813 | aliguori | |
118 | 065e2813 | aliguori | void migrate_fd_release(MigrationState *mig_state);
|
119 | 065e2813 | aliguori | |
120 | 065e2813 | aliguori | void migrate_fd_wait_for_unfreeze(void *opaque); |
121 | 065e2813 | aliguori | |
122 | 065e2813 | aliguori | int migrate_fd_close(void *opaque); |
123 | 065e2813 | aliguori | |
124 | 065e2813 | aliguori | static inline FdMigrationState *migrate_to_fms(MigrationState *mig_state) |
125 | 065e2813 | aliguori | { |
126 | 065e2813 | aliguori | return container_of(mig_state, FdMigrationState, mig_state);
|
127 | 065e2813 | aliguori | } |
128 | 065e2813 | aliguori | |
129 | 5bb7910a | aliguori | #endif |