aboutsummaryrefslogtreecommitdiff
path: root/migration/multifd-qpl.c
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2024-08-27 14:45:49 -0300
committerFabiano Rosas <farosas@suse.de>2024-09-03 16:24:34 -0300
commit90fa121c6c072c374ed5514fbc602039bb0ee878 (patch)
tree1ae410825b3aa05a74190d888ac65673b197b57c /migration/multifd-qpl.c
parentbc112a6c9008c242e13fcd8a642828266e5dceeb (diff)
downloadqemu-90fa121c6c072c374ed5514fbc602039bb0ee878.zip
qemu-90fa121c6c072c374ed5514fbc602039bb0ee878.tar.gz
qemu-90fa121c6c072c374ed5514fbc602039bb0ee878.tar.bz2
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>
Diffstat (limited to 'migration/multifd-qpl.c')
-rw-r--r--migration/multifd-qpl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/migration/multifd-qpl.c b/migration/multifd-qpl.c
index f8c84c5..db60c05 100644
--- a/migration/multifd-qpl.c
+++ b/migration/multifd-qpl.c
@@ -233,8 +233,10 @@ static void multifd_qpl_deinit(QplData *qpl)
static int multifd_qpl_send_setup(MultiFDSendParams *p, Error **errp)
{
QplData *qpl;
+ uint32_t page_size = multifd_ram_page_size();
+ uint32_t page_count = multifd_ram_page_count();
- qpl = multifd_qpl_init(p->page_count, p->page_size, errp);
+ qpl = multifd_qpl_init(page_count, page_size, errp);
if (!qpl) {
return -1;
}
@@ -245,7 +247,7 @@ static int multifd_qpl_send_setup(MultiFDSendParams *p, Error **errp)
* additional two IOVs are used to store packet header and compressed data
* length
*/
- p->iov = g_new0(struct iovec, p->page_count + 2);
+ p->iov = g_new0(struct iovec, page_count + 2);
return 0;
}
@@ -534,8 +536,10 @@ out:
static int multifd_qpl_recv_setup(MultiFDRecvParams *p, Error **errp)
{
QplData *qpl;
+ uint32_t page_size = multifd_ram_page_size();
+ uint32_t page_count = multifd_ram_page_count();
- qpl = multifd_qpl_init(p->page_count, p->page_size, errp);
+ qpl = multifd_qpl_init(page_count, page_size, errp);
if (!qpl) {
return -1;
}