mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-01 22:42:13 -06:00
migration/multifd: Remove pages->allocated
This value never changes and is always the same as page_count. We don't need a copy of it per-channel plus one in the extra slot. Remove it. Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
This commit is contained in:
parent
90fa121c6c
commit
171056ec91
2 changed files with 2 additions and 6 deletions
|
@ -396,7 +396,6 @@ static MultiFDPages_t *multifd_pages_init(uint32_t n)
|
||||||
{
|
{
|
||||||
MultiFDPages_t *pages = g_new0(MultiFDPages_t, 1);
|
MultiFDPages_t *pages = g_new0(MultiFDPages_t, 1);
|
||||||
|
|
||||||
pages->allocated = n;
|
|
||||||
pages->offset = g_new0(ram_addr_t, n);
|
pages->offset = g_new0(ram_addr_t, n);
|
||||||
|
|
||||||
return pages;
|
return pages;
|
||||||
|
@ -405,7 +404,6 @@ static MultiFDPages_t *multifd_pages_init(uint32_t n)
|
||||||
static void multifd_pages_clear(MultiFDPages_t *pages)
|
static void multifd_pages_clear(MultiFDPages_t *pages)
|
||||||
{
|
{
|
||||||
multifd_pages_reset(pages);
|
multifd_pages_reset(pages);
|
||||||
pages->allocated = 0;
|
|
||||||
g_free(pages->offset);
|
g_free(pages->offset);
|
||||||
pages->offset = NULL;
|
pages->offset = NULL;
|
||||||
g_free(pages);
|
g_free(pages);
|
||||||
|
@ -420,7 +418,7 @@ void multifd_send_fill_packet(MultiFDSendParams *p)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
packet->flags = cpu_to_be32(p->flags);
|
packet->flags = cpu_to_be32(p->flags);
|
||||||
packet->pages_alloc = cpu_to_be32(pages->allocated);
|
packet->pages_alloc = cpu_to_be32(multifd_ram_page_count());
|
||||||
packet->normal_pages = cpu_to_be32(pages->normal_num);
|
packet->normal_pages = cpu_to_be32(pages->normal_num);
|
||||||
packet->zero_pages = cpu_to_be32(zero_num);
|
packet->zero_pages = cpu_to_be32(zero_num);
|
||||||
packet->next_packet_size = cpu_to_be32(p->next_packet_size);
|
packet->next_packet_size = cpu_to_be32(p->next_packet_size);
|
||||||
|
@ -651,7 +649,7 @@ static inline bool multifd_queue_empty(MultiFDPages_t *pages)
|
||||||
|
|
||||||
static inline bool multifd_queue_full(MultiFDPages_t *pages)
|
static inline bool multifd_queue_full(MultiFDPages_t *pages)
|
||||||
{
|
{
|
||||||
return pages->num == pages->allocated;
|
return pages->num == multifd_ram_page_count();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void multifd_enqueue(MultiFDPages_t *pages, ram_addr_t offset)
|
static inline void multifd_enqueue(MultiFDPages_t *pages, ram_addr_t offset)
|
||||||
|
|
|
@ -76,8 +76,6 @@ typedef struct {
|
||||||
uint32_t num;
|
uint32_t num;
|
||||||
/* number of normal pages */
|
/* number of normal pages */
|
||||||
uint32_t normal_num;
|
uint32_t normal_num;
|
||||||
/* number of allocated pages */
|
|
||||||
uint32_t allocated;
|
|
||||||
/* offset of each page */
|
/* offset of each page */
|
||||||
ram_addr_t *offset;
|
ram_addr_t *offset;
|
||||||
RAMBlock *block;
|
RAMBlock *block;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue