mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
migration: Refactor MigrationState creation
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
22f00a4445
commit
0edda1c42a
6 changed files with 32 additions and 70 deletions
|
@ -71,7 +71,7 @@ MigrationState *exec_start_outgoing_migration(Monitor *mon,
|
|||
MigrationState *s;
|
||||
FILE *f;
|
||||
|
||||
s = g_malloc0(sizeof(*s));
|
||||
s = migrate_new(mon, bandwidth_limit, detach, blk, inc);
|
||||
|
||||
f = popen(command, "w");
|
||||
if (f == NULL) {
|
||||
|
@ -92,20 +92,6 @@ MigrationState *exec_start_outgoing_migration(Monitor *mon,
|
|||
s->close = exec_close;
|
||||
s->get_error = file_errno;
|
||||
s->write = file_write;
|
||||
s->cancel = migrate_fd_cancel;
|
||||
s->get_status = migrate_fd_get_status;
|
||||
s->release = migrate_fd_release;
|
||||
|
||||
s->blk = blk;
|
||||
s->shared = inc;
|
||||
|
||||
s->state = MIG_STATE_ACTIVE;
|
||||
s->mon = NULL;
|
||||
s->bandwidth_limit = bandwidth_limit;
|
||||
|
||||
if (!detach) {
|
||||
migrate_fd_monitor_suspend(s, mon);
|
||||
}
|
||||
|
||||
migrate_fd_connect(s);
|
||||
return s;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue