mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
migration/multifd: Change retval of multifd_queue_page()
Using int is an overkill when there're only two options. Change it to a boolean. Reviewed-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/r/20240202102857.110210-17-peterx@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
3ab4441d97
commit
d6556d174a
3 changed files with 7 additions and 6 deletions
|
@ -505,7 +505,8 @@ static int multifd_send_pages(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int multifd_queue_page(RAMBlock *block, ram_addr_t offset)
|
||||
/* Returns true if enqueue successful, false otherwise */
|
||||
bool multifd_queue_page(RAMBlock *block, ram_addr_t offset)
|
||||
{
|
||||
MultiFDPages_t *pages = multifd_send_state->pages;
|
||||
bool changed = false;
|
||||
|
@ -519,21 +520,21 @@ int multifd_queue_page(RAMBlock *block, ram_addr_t offset)
|
|||
pages->num++;
|
||||
|
||||
if (pages->num < pages->allocated) {
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (multifd_send_pages() < 0) {
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
return multifd_queue_page(block, offset);
|
||||
}
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Multifd send side hit an error; remember it and prepare to quit */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue