Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion emum.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ struct emu {
uint64_t sent;
uint64_t remaining;
int iter;

/*
* Send the pause command as soon as the live_done state is reached.
* This may be useful to avoid the live copy slowing down the VM's suspend
* operations.
*/
bool fast_pause;
};

struct stream_fd {
Expand Down Expand Up @@ -185,7 +192,8 @@ struct emu emus[] = {
.exp_total = 1000000,
.stream = NULL,
.status = not_done,
.iter = -1
.iter = -1,
.fast_pause = true,
},
{
.name = "vgpu",
Expand Down Expand Up @@ -1650,6 +1658,18 @@ static bool check_live_not_finished(struct emu *emu)
*/
static bool check_not_ready(struct emu *emu)
{
if (emu->status == live_done && emu->fast_pause) {
int rc;

emu->fast_pause = false;

rc = emp_client_send_cmd(emu->client, cmd_migrate_pause);
if (rc)
log_err("Error sending fast pause: %d, %s", -rc, strerror(-rc));
else
emu->enabled &= ~STAGE_PAUSE;
}

return (emu->enabled & STAGE_READY) && emu->status == not_done;
}

Expand Down Expand Up @@ -1792,6 +1812,8 @@ static int configure_emus(void)
log_err("Error adding vgpu argument: %d, %s", -rc, strerror(-rc));
return rc;
}

xenguest->fast_pause = false;
}
return 0;
}
Expand Down