mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
migration/multifd: Inline page_size and page_count
The MultiFD*Params structures are for per-channel data. Constant values should not be there because that needlessly wastes cycles and storage. The page_size and page_count fall into this category so move them inline in multifd.h. Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
This commit is contained in:
parent
bc112a6c90
commit
90fa121c6c
7 changed files with 71 additions and 55 deletions
|
@ -63,7 +63,7 @@ void multifd_send_zero_page_detect(MultiFDSendParams *p)
|
|||
while (i <= j) {
|
||||
uint64_t offset = pages->offset[i];
|
||||
|
||||
if (!buffer_is_zero(rb->host + offset, p->page_size)) {
|
||||
if (!buffer_is_zero(rb->host + offset, multifd_ram_page_size())) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ void multifd_recv_zero_page_process(MultiFDRecvParams *p)
|
|||
for (int i = 0; i < p->zero_num; i++) {
|
||||
void *page = p->host + p->zero[i];
|
||||
if (ramblock_recv_bitmap_test_byte_offset(p->block, p->zero[i])) {
|
||||
memset(page, 0, p->page_size);
|
||||
memset(page, 0, multifd_ram_page_size());
|
||||
} else {
|
||||
ramblock_recv_bitmap_set_offset(p->block, p->zero[i]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue