root / migration.h @ a8a358bf
History | View | Annotate | Download (2.9 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 | 376253ec | aliguori | #include "qemu-common.h" |
18 | 376253ec | aliguori | |
19 | 5bb7910a | aliguori | #define MIG_STATE_ERROR -1 |
20 | 5bb7910a | aliguori | #define MIG_STATE_COMPLETED 0 |
21 | 5bb7910a | aliguori | #define MIG_STATE_CANCELLED 1 |
22 | 5bb7910a | aliguori | #define MIG_STATE_ACTIVE 2 |
23 | 5bb7910a | aliguori | |
24 | 5bb7910a | aliguori | typedef struct MigrationState MigrationState; |
25 | 5bb7910a | aliguori | |
26 | 5bb7910a | aliguori | struct MigrationState
|
27 | 5bb7910a | aliguori | { |
28 | 5bb7910a | aliguori | /* FIXME: add more accessors to print migration info */
|
29 | 5bb7910a | aliguori | void (*cancel)(MigrationState *s);
|
30 | 5bb7910a | aliguori | int (*get_status)(MigrationState *s);
|
31 | 5bb7910a | aliguori | void (*release)(MigrationState *s);
|
32 | 5bb7910a | aliguori | }; |
33 | 5bb7910a | aliguori | |
34 | 065e2813 | aliguori | typedef struct FdMigrationState FdMigrationState; |
35 | 065e2813 | aliguori | |
36 | 065e2813 | aliguori | struct FdMigrationState
|
37 | 065e2813 | aliguori | { |
38 | 065e2813 | aliguori | MigrationState mig_state; |
39 | 065e2813 | aliguori | int64_t bandwidth_limit; |
40 | 065e2813 | aliguori | QEMUFile *file; |
41 | 065e2813 | aliguori | int fd;
|
42 | 731b0364 | aliguori | Monitor *mon_resume; |
43 | 065e2813 | aliguori | int state;
|
44 | 065e2813 | aliguori | int (*get_error)(struct FdMigrationState*); |
45 | 065e2813 | aliguori | int (*close)(struct FdMigrationState*); |
46 | 065e2813 | aliguori | int (*write)(struct FdMigrationState*, const void *, size_t); |
47 | 065e2813 | aliguori | void *opaque;
|
48 | 065e2813 | aliguori | }; |
49 | 065e2813 | aliguori | |
50 | 5bb7910a | aliguori | void qemu_start_incoming_migration(const char *uri); |
51 | 5bb7910a | aliguori | |
52 | 376253ec | aliguori | void do_migrate(Monitor *mon, int detach, const char *uri); |
53 | 5bb7910a | aliguori | |
54 | 376253ec | aliguori | void do_migrate_cancel(Monitor *mon);
|
55 | 5bb7910a | aliguori | |
56 | 376253ec | aliguori | void do_migrate_set_speed(Monitor *mon, const char *value); |
57 | 5bb7910a | aliguori | |
58 | a0a3fd60 | Glauber Costa | uint64_t migrate_max_downtime(void);
|
59 | a0a3fd60 | Glauber Costa | |
60 | 2ea42952 | Glauber Costa | void do_migrate_set_downtime(Monitor *mon, const char *value); |
61 | 2ea42952 | Glauber Costa | |
62 | 376253ec | aliguori | void do_info_migrate(Monitor *mon);
|
63 | 5bb7910a | aliguori | |
64 | 065e2813 | aliguori | int exec_start_incoming_migration(const char *host_port); |
65 | 065e2813 | aliguori | |
66 | 065e2813 | aliguori | MigrationState *exec_start_outgoing_migration(const char *host_port, |
67 | 065e2813 | aliguori | int64_t bandwidth_limit, |
68 | 065e2813 | aliguori | int detach);
|
69 | 065e2813 | aliguori | |
70 | 34c9dd8e | aliguori | int tcp_start_incoming_migration(const char *host_port); |
71 | 34c9dd8e | aliguori | |
72 | 34c9dd8e | aliguori | MigrationState *tcp_start_outgoing_migration(const char *host_port, |
73 | 34c9dd8e | aliguori | int64_t bandwidth_limit, |
74 | 34c9dd8e | aliguori | int detach);
|
75 | 34c9dd8e | aliguori | |
76 | 4951f65b | Chris Lalancette | int unix_start_incoming_migration(const char *path); |
77 | 4951f65b | Chris Lalancette | |
78 | 4951f65b | Chris Lalancette | MigrationState *unix_start_outgoing_migration(const char *path, |
79 | 4951f65b | Chris Lalancette | int64_t bandwidth_limit, |
80 | 4951f65b | Chris Lalancette | int detach);
|
81 | 4951f65b | Chris Lalancette | |
82 | 5ac1fad3 | Paolo Bonzini | int fd_start_incoming_migration(const char *path); |
83 | 5ac1fad3 | Paolo Bonzini | |
84 | 5ac1fad3 | Paolo Bonzini | MigrationState *fd_start_outgoing_migration(Monitor *mon, |
85 | 5ac1fad3 | Paolo Bonzini | const char *fdname, |
86 | 5ac1fad3 | Paolo Bonzini | int64_t bandwidth_limit, |
87 | 5ac1fad3 | Paolo Bonzini | int detach);
|
88 | 5ac1fad3 | Paolo Bonzini | |
89 | 731b0364 | aliguori | void migrate_fd_monitor_suspend(FdMigrationState *s);
|
90 | 731b0364 | aliguori | |
91 | 065e2813 | aliguori | void migrate_fd_error(FdMigrationState *s);
|
92 | 065e2813 | aliguori | |
93 | 065e2813 | aliguori | void migrate_fd_cleanup(FdMigrationState *s);
|
94 | 065e2813 | aliguori | |
95 | 065e2813 | aliguori | void migrate_fd_put_notify(void *opaque); |
96 | 065e2813 | aliguori | |
97 | 065e2813 | aliguori | ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size); |
98 | 065e2813 | aliguori | |
99 | 065e2813 | aliguori | void migrate_fd_connect(FdMigrationState *s);
|
100 | 065e2813 | aliguori | |
101 | 065e2813 | aliguori | void migrate_fd_put_ready(void *opaque); |
102 | 065e2813 | aliguori | |
103 | 065e2813 | aliguori | int migrate_fd_get_status(MigrationState *mig_state);
|
104 | 065e2813 | aliguori | |
105 | 065e2813 | aliguori | void migrate_fd_cancel(MigrationState *mig_state);
|
106 | 065e2813 | aliguori | |
107 | 065e2813 | aliguori | void migrate_fd_release(MigrationState *mig_state);
|
108 | 065e2813 | aliguori | |
109 | 065e2813 | aliguori | void migrate_fd_wait_for_unfreeze(void *opaque); |
110 | 065e2813 | aliguori | |
111 | 065e2813 | aliguori | int migrate_fd_close(void *opaque); |
112 | 065e2813 | aliguori | |
113 | 065e2813 | aliguori | static inline FdMigrationState *migrate_to_fms(MigrationState *mig_state) |
114 | 065e2813 | aliguori | { |
115 | 065e2813 | aliguori | return container_of(mig_state, FdMigrationState, mig_state);
|
116 | 065e2813 | aliguori | } |
117 | 065e2813 | aliguori | |
118 | 5bb7910a | aliguori | #endif |