Annotation of qemu/migration.h, revision 1.1.1.6

1.1       root        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: 
1.1.1.3   root       17: #include "qdict.h"
1.1.1.2   root       18: #include "qemu-common.h"
1.1.1.5   root       19: #include "notify.h"
1.1.1.2   root       20: 
1.1       root       21: #define MIG_STATE_ERROR                -1
                     22: #define MIG_STATE_COMPLETED    0
                     23: #define MIG_STATE_CANCELLED    1
                     24: #define MIG_STATE_ACTIVE       2
                     25: 
                     26: typedef struct MigrationState MigrationState;
                     27: 
                     28: struct MigrationState
                     29: {
                     30:     /* FIXME: add more accessors to print migration info */
                     31:     void (*cancel)(MigrationState *s);
                     32:     int (*get_status)(MigrationState *s);
                     33:     void (*release)(MigrationState *s);
1.1.1.3   root       34:     int blk;
                     35:     int shared;
1.1       root       36: };
                     37: 
                     38: typedef struct FdMigrationState FdMigrationState;
                     39: 
                     40: struct FdMigrationState
                     41: {
                     42:     MigrationState mig_state;
                     43:     int64_t bandwidth_limit;
                     44:     QEMUFile *file;
                     45:     int fd;
1.1.1.3   root       46:     Monitor *mon;
1.1       root       47:     int state;
                     48:     int (*get_error)(struct FdMigrationState*);
                     49:     int (*close)(struct FdMigrationState*);
                     50:     int (*write)(struct FdMigrationState*, const void *, size_t);
                     51:     void *opaque;
                     52: };
                     53: 
1.1.1.4   root       54: void process_incoming_migration(QEMUFile *f);
1.1       root       55: 
1.1.1.4   root       56: int qemu_start_incoming_migration(const char *uri);
1.1.1.2   root       57: 
1.1.1.4   root       58: int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data);
1.1       root       59: 
1.1.1.4   root       60: int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data);
                     61: 
                     62: int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data);
1.1       root       63: 
1.1.1.2   root       64: uint64_t migrate_max_downtime(void);
1.1       root       65: 
1.1.1.4   root       66: int do_migrate_set_downtime(Monitor *mon, const QDict *qdict,
                     67:                             QObject **ret_data);
1.1.1.2   root       68: 
1.1.1.3   root       69: void do_info_migrate_print(Monitor *mon, const QObject *data);
                     70: 
                     71: void do_info_migrate(Monitor *mon, QObject **ret_data);
1.1       root       72: 
                     73: int exec_start_incoming_migration(const char *host_port);
                     74: 
1.1.1.3   root       75: MigrationState *exec_start_outgoing_migration(Monitor *mon,
                     76:                                               const char *host_port,
                     77:                                              int64_t bandwidth_limit,
                     78:                                              int detach,
                     79:                                              int blk,
                     80:                                              int inc);
1.1       root       81: 
                     82: int tcp_start_incoming_migration(const char *host_port);
                     83: 
1.1.1.3   root       84: MigrationState *tcp_start_outgoing_migration(Monitor *mon,
                     85:                                              const char *host_port,
1.1       root       86:                                             int64_t bandwidth_limit,
1.1.1.3   root       87:                                             int detach,
                     88:                                             int blk,
                     89:                                             int inc);
                     90: 
                     91: int unix_start_incoming_migration(const char *path);
                     92: 
                     93: MigrationState *unix_start_outgoing_migration(Monitor *mon,
                     94:                                               const char *path,
                     95:                                              int64_t bandwidth_limit,
                     96:                                              int detach,
                     97:                                              int blk,
                     98:                                              int inc);
                     99: 
                    100: int fd_start_incoming_migration(const char *path);
                    101: 
                    102: MigrationState *fd_start_outgoing_migration(Monitor *mon,
                    103:                                            const char *fdname,
                    104:                                            int64_t bandwidth_limit,
                    105:                                            int detach,
                    106:                                            int blk,
                    107:                                            int inc);
1.1       root      108: 
1.1.1.3   root      109: void migrate_fd_monitor_suspend(FdMigrationState *s, Monitor *mon);
1.1.1.2   root      110: 
1.1       root      111: void migrate_fd_error(FdMigrationState *s);
                    112: 
1.1.1.4   root      113: int migrate_fd_cleanup(FdMigrationState *s);
1.1       root      114: 
                    115: void migrate_fd_put_notify(void *opaque);
                    116: 
                    117: ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size);
                    118: 
                    119: void migrate_fd_connect(FdMigrationState *s);
                    120: 
                    121: void migrate_fd_put_ready(void *opaque);
                    122: 
                    123: int migrate_fd_get_status(MigrationState *mig_state);
                    124: 
                    125: void migrate_fd_cancel(MigrationState *mig_state);
                    126: 
                    127: void migrate_fd_release(MigrationState *mig_state);
                    128: 
                    129: void migrate_fd_wait_for_unfreeze(void *opaque);
                    130: 
                    131: int migrate_fd_close(void *opaque);
                    132: 
                    133: static inline FdMigrationState *migrate_to_fms(MigrationState *mig_state)
                    134: {
                    135:     return container_of(mig_state, FdMigrationState, mig_state);
                    136: }
                    137: 
1.1.1.5   root      138: void add_migration_state_change_notifier(Notifier *notify);
                    139: void remove_migration_state_change_notifier(Notifier *notify);
                    140: int get_migration_state(void);
                    141: 
1.1.1.6 ! root      142: uint64_t ram_bytes_remaining(void);
        !           143: uint64_t ram_bytes_transferred(void);
        !           144: uint64_t ram_bytes_total(void);
        !           145: 
        !           146: int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque);
        !           147: int ram_load(QEMUFile *f, void *opaque, int version_id);
        !           148: 
        !           149: extern int incoming_expected;
        !           150: 
1.1       root      151: #endif

unix.superglobalmegacorp.com