aboutsummaryrefslogtreecommitdiff
path: root/migration.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-10-20 08:46:55 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-10-20 08:46:55 -0500
commita6e43daa732b90b9ca58e7c38f6faa5a82f4b176 (patch)
tree7c8c8e63ff65cef5e3f9b0e3cded21b160e4e93d /migration.h
parent46cd37e7718f6c2c502228a61b3a0811c849c52f (diff)
parentee86c61f285042386c0a27edf69300627a1987b4 (diff)
Merge remote-tracking branch 'quintela/migration-pull' into staging
Diffstat (limited to 'migration.h')
-rw-r--r--migration.h85
1 files changed, 12 insertions, 73 deletions
diff --git a/migration.h b/migration.h
index 050c56c5a4..a1f80d0728 100644
--- a/migration.h
+++ b/migration.h
@@ -18,37 +18,21 @@
#include "qemu-common.h"
#include "notify.h"
-#define MIG_STATE_ERROR -1
-#define MIG_STATE_COMPLETED 0
-#define MIG_STATE_CANCELLED 1
-#define MIG_STATE_ACTIVE 2
-
typedef struct MigrationState MigrationState;
struct MigrationState
{
- /* FIXME: add more accessors to print migration info */
- void (*cancel)(MigrationState *s);
- int (*get_status)(MigrationState *s);
- void (*release)(MigrationState *s);
- int blk;
- int shared;
-};
-
-typedef struct FdMigrationState FdMigrationState;
-
-struct FdMigrationState
-{
- MigrationState mig_state;
int64_t bandwidth_limit;
QEMUFile *file;
int fd;
Monitor *mon;
int state;
- int (*get_error)(struct FdMigrationState*);
- int (*close)(struct FdMigrationState*);
- int (*write)(struct FdMigrationState*, const void *, size_t);
+ int (*get_error)(MigrationState *s);
+ int (*close)(MigrationState *s);
+ int (*write)(MigrationState *s, const void *buff, size_t size);
void *opaque;
+ int blk;
+ int shared;
};
void process_incoming_migration(QEMUFile *f);
@@ -72,72 +56,27 @@ void do_info_migrate(Monitor *mon, QObject **ret_data);
int exec_start_incoming_migration(const char *host_port);
-MigrationState *exec_start_outgoing_migration(Monitor *mon,
- const char *host_port,
- int64_t bandwidth_limit,
- int detach,
- int blk,
- int inc);
+int exec_start_outgoing_migration(MigrationState *s, const char *host_port);
int tcp_start_incoming_migration(const char *host_port);
-MigrationState *tcp_start_outgoing_migration(Monitor *mon,
- const char *host_port,
- int64_t bandwidth_limit,
- int detach,
- int blk,
- int inc);
+int tcp_start_outgoing_migration(MigrationState *s, const char *host_port);
int unix_start_incoming_migration(const char *path);
-MigrationState *unix_start_outgoing_migration(Monitor *mon,
- const char *path,
- int64_t bandwidth_limit,
- int detach,
- int blk,
- int inc);
+int unix_start_outgoing_migration(MigrationState *s, const char *path);
int fd_start_incoming_migration(const char *path);
-MigrationState *fd_start_outgoing_migration(Monitor *mon,
- const char *fdname,
- int64_t bandwidth_limit,
- int detach,
- int blk,
- int inc);
-
-void migrate_fd_monitor_suspend(FdMigrationState *s, Monitor *mon);
-
-void migrate_fd_error(FdMigrationState *s);
+int fd_start_outgoing_migration(MigrationState *s, const char *fdname);
-int migrate_fd_cleanup(FdMigrationState *s);
+void migrate_fd_error(MigrationState *s);
-void migrate_fd_put_notify(void *opaque);
-
-ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size);
-
-void migrate_fd_connect(FdMigrationState *s);
-
-void migrate_fd_put_ready(void *opaque);
-
-int migrate_fd_get_status(MigrationState *mig_state);
-
-void migrate_fd_cancel(MigrationState *mig_state);
-
-void migrate_fd_release(MigrationState *mig_state);
-
-void migrate_fd_wait_for_unfreeze(void *opaque);
-
-int migrate_fd_close(void *opaque);
-
-static inline FdMigrationState *migrate_to_fms(MigrationState *mig_state)
-{
- return container_of(mig_state, FdMigrationState, mig_state);
-}
+void migrate_fd_connect(MigrationState *s);
void add_migration_state_change_notifier(Notifier *notify);
void remove_migration_state_change_notifier(Notifier *notify);
-int get_migration_state(void);
+bool migration_has_finished(MigrationState *);
uint64_t ram_bytes_remaining(void);
uint64_t ram_bytes_transferred(void);