root / migration.h @ 16415335
History | View | Annotate | Download (2.5 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 | 731b0364 | aliguori | void migrate_fd_monitor_suspend(FdMigrationState *s);
|
77 | 731b0364 | aliguori | |
78 | 065e2813 | aliguori | void migrate_fd_error(FdMigrationState *s);
|
79 | 065e2813 | aliguori | |
80 | 065e2813 | aliguori | void migrate_fd_cleanup(FdMigrationState *s);
|
81 | 065e2813 | aliguori | |
82 | 065e2813 | aliguori | void migrate_fd_put_notify(void *opaque); |
83 | 065e2813 | aliguori | |
84 | 065e2813 | aliguori | ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size); |
85 | 065e2813 | aliguori | |
86 | 065e2813 | aliguori | void migrate_fd_connect(FdMigrationState *s);
|
87 | 065e2813 | aliguori | |
88 | 065e2813 | aliguori | void migrate_fd_put_ready(void *opaque); |
89 | 065e2813 | aliguori | |
90 | 065e2813 | aliguori | int migrate_fd_get_status(MigrationState *mig_state);
|
91 | 065e2813 | aliguori | |
92 | 065e2813 | aliguori | void migrate_fd_cancel(MigrationState *mig_state);
|
93 | 065e2813 | aliguori | |
94 | 065e2813 | aliguori | void migrate_fd_release(MigrationState *mig_state);
|
95 | 065e2813 | aliguori | |
96 | 065e2813 | aliguori | void migrate_fd_wait_for_unfreeze(void *opaque); |
97 | 065e2813 | aliguori | |
98 | 065e2813 | aliguori | int migrate_fd_close(void *opaque); |
99 | 065e2813 | aliguori | |
100 | 065e2813 | aliguori | static inline FdMigrationState *migrate_to_fms(MigrationState *mig_state) |
101 | 065e2813 | aliguori | { |
102 | 065e2813 | aliguori | return container_of(mig_state, FdMigrationState, mig_state);
|
103 | 065e2813 | aliguori | } |
104 | 065e2813 | aliguori | |
105 | 5bb7910a | aliguori | #endif |