mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
Block live migration
This patch introduces block migration called during live migration. Block are being copied to the destination in an async way. First the code will transfer the whole disk and then transfer all dirty blocks accumulted during the migration. Still need to improve transition from the iterative phase of migration to the end phase. For now transition will take place when all blocks transfered once, all the dirty blocks will be transfered during the end phase (guest is suspended). Changes from v4: - Global variabels moved to a global state structure allocated dynamically. - Minor coding style issues. - Poll block.c for tracking of dirty blocks instead of manage it here. Signed-off-by: Liran Schour <lirans@il.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
7cd1e32a86
commit
c163b5cae9
14 changed files with 713 additions and 40 deletions
9
hw/hw.h
9
hw/hw.h
|
@ -43,12 +43,14 @@ typedef int (QEMUFileRateLimit)(void *opaque);
|
|||
* the old rate otherwise
|
||||
*/
|
||||
typedef size_t (QEMUFileSetRateLimit)(void *opaque, size_t new_rate);
|
||||
typedef size_t (QEMUFileGetRateLimit)(void *opaque);
|
||||
|
||||
QEMUFile *qemu_fopen_ops(void *opaque, QEMUFilePutBufferFunc *put_buffer,
|
||||
QEMUFileGetBufferFunc *get_buffer,
|
||||
QEMUFileCloseFunc *close,
|
||||
QEMUFileRateLimit *rate_limit,
|
||||
QEMUFileSetRateLimit *set_rate_limit);
|
||||
QEMUFileSetRateLimit *set_rate_limit,
|
||||
QEMUFileGetRateLimit *get_rate_limit);
|
||||
QEMUFile *qemu_fopen(const char *filename, const char *mode);
|
||||
QEMUFile *qemu_fdopen(int fd, const char *mode);
|
||||
QEMUFile *qemu_fopen_socket(int fd);
|
||||
|
@ -85,6 +87,7 @@ unsigned int qemu_get_be32(QEMUFile *f);
|
|||
uint64_t qemu_get_be64(QEMUFile *f);
|
||||
int qemu_file_rate_limit(QEMUFile *f);
|
||||
size_t qemu_file_set_rate_limit(QEMUFile *f, size_t new_rate);
|
||||
size_t qemu_file_get_rate_limit(QEMUFile *f);
|
||||
int qemu_file_has_error(QEMUFile *f);
|
||||
void qemu_file_set_error(QEMUFile *f);
|
||||
|
||||
|
@ -239,6 +242,7 @@ static inline void qemu_get_sbe64s(QEMUFile *f, int64_t *pv)
|
|||
int64_t qemu_ftell(QEMUFile *f);
|
||||
int64_t qemu_fseek(QEMUFile *f, int64_t pos, int whence);
|
||||
|
||||
typedef void SaveSetParamsHandler(int blk_enable, int shared, void * opaque);
|
||||
typedef void SaveStateHandler(QEMUFile *f, void *opaque);
|
||||
typedef int SaveLiveStateHandler(QEMUFile *f, int stage, void *opaque);
|
||||
typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
|
||||
|
@ -253,7 +257,8 @@ int register_savevm(const char *idstr,
|
|||
int register_savevm_live(const char *idstr,
|
||||
int instance_id,
|
||||
int version_id,
|
||||
SaveLiveStateHandler *save_live_state,
|
||||
SaveSetParamsHandler *set_params,
|
||||
SaveLiveStateHandler *save_live_state,
|
||||
SaveStateHandler *save_state,
|
||||
LoadStateHandler *load_state,
|
||||
void *opaque);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue