File:  [Qemu by Fabrice Bellard] / qemu / migration.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:50:52 2018 UTC (3 years, 2 months ago) by root
Branches: qemu, MAIN
CVS tags: qemu0105, qemu0104, qemu0103, qemu0102, qemu0101, qemu0100, HEAD
qemu 0.10.0

    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: #define MIG_STATE_ERROR		-1
   18: #define MIG_STATE_COMPLETED	0
   19: #define MIG_STATE_CANCELLED	1
   20: #define MIG_STATE_ACTIVE	2
   21: 
   22: typedef struct MigrationState MigrationState;
   23: 
   24: struct MigrationState
   25: {
   26:     /* FIXME: add more accessors to print migration info */
   27:     void (*cancel)(MigrationState *s);
   28:     int (*get_status)(MigrationState *s);
   29:     void (*release)(MigrationState *s);
   30: };
   31: 
   32: typedef struct FdMigrationState FdMigrationState;
   33: 
   34: struct FdMigrationState
   35: {
   36:     MigrationState mig_state;
   37:     int64_t bandwidth_limit;
   38:     QEMUFile *file;
   39:     int fd;
   40:     int detach;
   41:     int state;
   42:     int (*get_error)(struct FdMigrationState*);
   43:     int (*close)(struct FdMigrationState*);
   44:     int (*write)(struct FdMigrationState*, const void *, size_t);
   45:     void *opaque;
   46: };
   47: 
   48: void qemu_start_incoming_migration(const char *uri);
   49: 
   50: void do_migrate(int detach, const char *uri);
   51: 
   52: void do_migrate_cancel(void);
   53: 
   54: void do_migrate_set_speed(const char *value);
   55: 
   56: void do_info_migrate(void);
   57: 
   58: int exec_start_incoming_migration(const char *host_port);
   59: 
   60: MigrationState *exec_start_outgoing_migration(const char *host_port,
   61: 					     int64_t bandwidth_limit,
   62: 					     int detach);
   63: 
   64: int tcp_start_incoming_migration(const char *host_port);
   65: 
   66: MigrationState *tcp_start_outgoing_migration(const char *host_port,
   67: 					     int64_t bandwidth_limit,
   68: 					     int detach);
   69: 
   70: void migrate_fd_error(FdMigrationState *s);
   71: 
   72: void migrate_fd_cleanup(FdMigrationState *s);
   73: 
   74: void migrate_fd_put_notify(void *opaque);
   75: 
   76: ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size);
   77: 
   78: void migrate_fd_connect(FdMigrationState *s);
   79: 
   80: void migrate_fd_put_ready(void *opaque);
   81: 
   82: int migrate_fd_get_status(MigrationState *mig_state);
   83: 
   84: void migrate_fd_cancel(MigrationState *mig_state);
   85: 
   86: void migrate_fd_release(MigrationState *mig_state);
   87: 
   88: void migrate_fd_wait_for_unfreeze(void *opaque);
   89: 
   90: int migrate_fd_close(void *opaque);
   91: 
   92: static inline FdMigrationState *migrate_to_fms(MigrationState *mig_state)
   93: {
   94:     return container_of(mig_state, FdMigrationState, mig_state);
   95: }
   96: 
   97: #endif

unix.superglobalmegacorp.com