qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 15/16] migration/multifd: Register nocomp ops dynamically


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v4 15/16] migration/multifd: Register nocomp ops dynamically
Date: Mon, 26 Aug 2024 08:32:08 +0200
User-agent: Mozilla Thunderbird

On 23/8/24 19:39, Fabiano Rosas wrote:
Prior to moving the ram code into multifd-nocomp.c, change the code to
register the nocomp ops dynamically so we don't need to have the ops
structure defined in multifd.c.

While here, move the ops struct initialization to the end of the file
to make the next diff cleaner.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
  migration/multifd.c | 32 +++++++++++++++++++-------------
  1 file changed, 19 insertions(+), 13 deletions(-)


+static MultiFDMethods multifd_nocomp_ops = {

As a follow up cleanup, have multifd_register_ops() take a
const MultiFDMethods*, making these arrays also const.

+    .send_setup = multifd_nocomp_send_setup,
+    .send_cleanup = multifd_nocomp_send_cleanup,
+    .send_prepare = multifd_nocomp_send_prepare,
+    .recv_setup = multifd_nocomp_recv_setup,
+    .recv_cleanup = multifd_nocomp_recv_cleanup,
+    .recv = multifd_nocomp_recv
+};
+
+static void multifd_nocomp_register(void)
+{
+    multifd_register_ops(MULTIFD_COMPRESSION_NONE, &multifd_nocomp_ops);
+}
+
+migration_init(multifd_nocomp_register);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]