mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
rdma: introduce qemu_update_position()
RDMA writes happen asynchronously, and thus the performance accounting also needs to be able to occur asynchronously. This allows anybody to call into savevm.c to update both f->pos as well as into arch_init.c to update the acct_info structure with up-to-date values when the RDMA transfer actually completes. Reviewed-by: Juan Quintela <quintela@redhat.com> Tested-by: Chegu Vinod <chegu_vinod@hp.com> Tested-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
f4abc9d621
commit
2b0ce0797d
4 changed files with 20 additions and 0 deletions
12
arch_init.c
12
arch_init.c
|
@ -493,6 +493,18 @@ static int ram_save_block(QEMUFile *f, bool last_stage)
|
|||
|
||||
static uint64_t bytes_transferred;
|
||||
|
||||
void acct_update_position(QEMUFile *f, size_t size, bool zero)
|
||||
{
|
||||
uint64_t pages = size / TARGET_PAGE_SIZE;
|
||||
if (zero) {
|
||||
acct_info.dup_pages += pages;
|
||||
} else {
|
||||
acct_info.norm_pages += pages;
|
||||
bytes_transferred += size;
|
||||
qemu_update_position(f, size);
|
||||
}
|
||||
}
|
||||
|
||||
static ram_addr_t ram_save_remaining(void)
|
||||
{
|
||||
return migration_dirty_pages;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue