]> git.proxmox.com Git - mirror_qemu.git/blame_incremental - migration.h
i2c: smbus: convert to QEMU Object Model
[mirror_qemu.git] / migration.h
... / ...
CommitLineData
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#include "qdict.h"
18#include "qemu-common.h"
19#include "notify.h"
20#include "error.h"
21
22typedef struct MigrationState MigrationState;
23
24struct MigrationState
25{
26 int64_t bandwidth_limit;
27 QEMUFile *file;
28 int fd;
29 Monitor *mon;
30 int state;
31 int (*get_error)(MigrationState *s);
32 int (*close)(MigrationState *s);
33 int (*write)(MigrationState *s, const void *buff, size_t size);
34 void *opaque;
35 int blk;
36 int shared;
37};
38
39void process_incoming_migration(QEMUFile *f);
40
41int qemu_start_incoming_migration(const char *uri);
42
43int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data);
44
45uint64_t migrate_max_downtime(void);
46
47void do_info_migrate_print(Monitor *mon, const QObject *data);
48
49void do_info_migrate(Monitor *mon, QObject **ret_data);
50
51int exec_start_incoming_migration(const char *host_port);
52
53int exec_start_outgoing_migration(MigrationState *s, const char *host_port);
54
55int tcp_start_incoming_migration(const char *host_port);
56
57int tcp_start_outgoing_migration(MigrationState *s, const char *host_port);
58
59int unix_start_incoming_migration(const char *path);
60
61int unix_start_outgoing_migration(MigrationState *s, const char *path);
62
63int fd_start_incoming_migration(const char *path);
64
65int fd_start_outgoing_migration(MigrationState *s, const char *fdname);
66
67void migrate_fd_error(MigrationState *s);
68
69void migrate_fd_connect(MigrationState *s);
70
71void add_migration_state_change_notifier(Notifier *notify);
72void remove_migration_state_change_notifier(Notifier *notify);
73bool migration_is_active(MigrationState *);
74bool migration_has_finished(MigrationState *);
75bool migration_has_failed(MigrationState *);
76
77uint64_t ram_bytes_remaining(void);
78uint64_t ram_bytes_transferred(void);
79uint64_t ram_bytes_total(void);
80
81int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque);
82int ram_load(QEMUFile *f, void *opaque, int version_id);
83
84/**
85 * @migrate_add_blocker - prevent migration from proceeding
86 *
87 * @reason - an error to be returned whenever migration is attempted
88 */
89void migrate_add_blocker(Error *reason);
90
91/**
92 * @migrate_del_blocker - remove a blocking error from migration
93 *
94 * @reason - the error blocking migration
95 */
96void migrate_del_blocker(Error *reason);
97
98#endif