qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: peterx@redhat.com
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: peterx@redhat.com, "Daniel P . Berrangé" <berrange@redhat.com>,
	"Prasad Pandit" <ppandit@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>
Subject: [PULL 15/27] migration/multifd: Rename MultiFDSend|RecvParams::data to compress_data
Date: Mon,  4 Mar 2024 09:26:22 +0800	[thread overview]
Message-ID: <20240304012634.95520-16-peterx@redhat.com> (raw)
In-Reply-To: <20240304012634.95520-1-peterx@redhat.com>

From: Fabiano Rosas <farosas@suse.de>

Use a more specific name for the compression data so we can use the
generic for the multifd core code.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240229153017.2221-13-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 migration/multifd.h      |  4 ++--
 migration/multifd-zlib.c | 20 ++++++++++----------
 migration/multifd-zstd.c | 20 ++++++++++----------
 3 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/migration/multifd.h b/migration/multifd.h
index b3fe27ae93..adccd3532f 100644
--- a/migration/multifd.h
+++ b/migration/multifd.h
@@ -127,7 +127,7 @@ typedef struct {
     /* number of iovs used */
     uint32_t iovs_num;
     /* used for compression methods */
-    void *data;
+    void *compress_data;
 }  MultiFDSendParams;
 
 typedef struct {
@@ -183,7 +183,7 @@ typedef struct {
     /* num of non zero pages */
     uint32_t normal_num;
     /* used for de-compression methods */
-    void *data;
+    void *compress_data;
 } MultiFDRecvParams;
 
 typedef struct {
diff --git a/migration/multifd-zlib.c b/migration/multifd-zlib.c
index 012e3bdea1..2a8f5fc9a6 100644
--- a/migration/multifd-zlib.c
+++ b/migration/multifd-zlib.c
@@ -69,7 +69,7 @@ static int zlib_send_setup(MultiFDSendParams *p, Error **errp)
         err_msg = "out of memory for buf";
         goto err_free_zbuff;
     }
-    p->data = z;
+    p->compress_data = z;
     return 0;
 
 err_free_zbuff:
@@ -92,15 +92,15 @@ err_free_z:
  */
 static void zlib_send_cleanup(MultiFDSendParams *p, Error **errp)
 {
-    struct zlib_data *z = p->data;
+    struct zlib_data *z = p->compress_data;
 
     deflateEnd(&z->zs);
     g_free(z->zbuff);
     z->zbuff = NULL;
     g_free(z->buf);
     z->buf = NULL;
-    g_free(p->data);
-    p->data = NULL;
+    g_free(p->compress_data);
+    p->compress_data = NULL;
 }
 
 /**
@@ -117,7 +117,7 @@ static void zlib_send_cleanup(MultiFDSendParams *p, Error **errp)
 static int zlib_send_prepare(MultiFDSendParams *p, Error **errp)
 {
     MultiFDPages_t *pages = p->pages;
-    struct zlib_data *z = p->data;
+    struct zlib_data *z = p->compress_data;
     z_stream *zs = &z->zs;
     uint32_t out_size = 0;
     int ret;
@@ -194,7 +194,7 @@ static int zlib_recv_setup(MultiFDRecvParams *p, Error **errp)
     struct zlib_data *z = g_new0(struct zlib_data, 1);
     z_stream *zs = &z->zs;
 
-    p->data = z;
+    p->compress_data = z;
     zs->zalloc = Z_NULL;
     zs->zfree = Z_NULL;
     zs->opaque = Z_NULL;
@@ -224,13 +224,13 @@ static int zlib_recv_setup(MultiFDRecvParams *p, Error **errp)
  */
 static void zlib_recv_cleanup(MultiFDRecvParams *p)
 {
-    struct zlib_data *z = p->data;
+    struct zlib_data *z = p->compress_data;
 
     inflateEnd(&z->zs);
     g_free(z->zbuff);
     z->zbuff = NULL;
-    g_free(p->data);
-    p->data = NULL;
+    g_free(p->compress_data);
+    p->compress_data = NULL;
 }
 
 /**
@@ -246,7 +246,7 @@ static void zlib_recv_cleanup(MultiFDRecvParams *p)
  */
 static int zlib_recv_pages(MultiFDRecvParams *p, Error **errp)
 {
-    struct zlib_data *z = p->data;
+    struct zlib_data *z = p->compress_data;
     z_stream *zs = &z->zs;
     uint32_t in_size = p->next_packet_size;
     /* we measure the change of total_out */
diff --git a/migration/multifd-zstd.c b/migration/multifd-zstd.c
index dc8fe43e94..593cf290ad 100644
--- a/migration/multifd-zstd.c
+++ b/migration/multifd-zstd.c
@@ -52,7 +52,7 @@ static int zstd_send_setup(MultiFDSendParams *p, Error **errp)
     struct zstd_data *z = g_new0(struct zstd_data, 1);
     int res;
 
-    p->data = z;
+    p->compress_data = z;
     z->zcs = ZSTD_createCStream();
     if (!z->zcs) {
         g_free(z);
@@ -90,14 +90,14 @@ static int zstd_send_setup(MultiFDSendParams *p, Error **errp)
  */
 static void zstd_send_cleanup(MultiFDSendParams *p, Error **errp)
 {
-    struct zstd_data *z = p->data;
+    struct zstd_data *z = p->compress_data;
 
     ZSTD_freeCStream(z->zcs);
     z->zcs = NULL;
     g_free(z->zbuff);
     z->zbuff = NULL;
-    g_free(p->data);
-    p->data = NULL;
+    g_free(p->compress_data);
+    p->compress_data = NULL;
 }
 
 /**
@@ -114,7 +114,7 @@ static void zstd_send_cleanup(MultiFDSendParams *p, Error **errp)
 static int zstd_send_prepare(MultiFDSendParams *p, Error **errp)
 {
     MultiFDPages_t *pages = p->pages;
-    struct zstd_data *z = p->data;
+    struct zstd_data *z = p->compress_data;
     int ret;
     uint32_t i;
 
@@ -183,7 +183,7 @@ static int zstd_recv_setup(MultiFDRecvParams *p, Error **errp)
     struct zstd_data *z = g_new0(struct zstd_data, 1);
     int ret;
 
-    p->data = z;
+    p->compress_data = z;
     z->zds = ZSTD_createDStream();
     if (!z->zds) {
         g_free(z);
@@ -221,14 +221,14 @@ static int zstd_recv_setup(MultiFDRecvParams *p, Error **errp)
  */
 static void zstd_recv_cleanup(MultiFDRecvParams *p)
 {
-    struct zstd_data *z = p->data;
+    struct zstd_data *z = p->compress_data;
 
     ZSTD_freeDStream(z->zds);
     z->zds = NULL;
     g_free(z->zbuff);
     z->zbuff = NULL;
-    g_free(p->data);
-    p->data = NULL;
+    g_free(p->compress_data);
+    p->compress_data = NULL;
 }
 
 /**
@@ -248,7 +248,7 @@ static int zstd_recv_pages(MultiFDRecvParams *p, Error **errp)
     uint32_t out_size = 0;
     uint32_t expected_size = p->normal_num * p->page_size;
     uint32_t flags = p->flags & MULTIFD_FLAG_COMPRESSION_MASK;
-    struct zstd_data *z = p->data;
+    struct zstd_data *z = p->compress_data;
     int ret;
     int i;
 
-- 
2.44.0



  parent reply	other threads:[~2024-03-04  1:28 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04  1:26 [PULL 00/27] Migration next patches peterx
2024-03-04  1:26 ` [PULL 01/27] migration: massage cpr-reboot documentation peterx
2024-03-04  1:26 ` [PULL 02/27] migration: Properly apply migration compression level parameters peterx
2024-03-04  1:26 ` [PULL 03/27] tests/migration: Set compression level in migration tests peterx
2024-03-04  1:26 ` [PULL 04/27] migration/multifd: Cleanup multifd_recv_sync_main peterx
2024-03-04  1:26 ` [PULL 05/27] io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file peterx
2024-03-04  1:26 ` [PULL 06/27] io: Add generic pwritev/preadv interface peterx
2024-03-04  1:26 ` [PULL 07/27] io: implement io_pwritev/preadv for QIOChannelFile peterx
2024-03-04  1:26 ` [PULL 08/27] io: fsync before closing a file channel peterx
2024-03-04  1:26 ` [PULL 09/27] migration/qemu-file: add utility methods for working with seekable channels peterx
2024-03-04  1:26 ` [PULL 10/27] migration/ram: Introduce 'mapped-ram' migration capability peterx
2024-03-04  1:26 ` [PULL 11/27] migration: Add mapped-ram URI compatibility check peterx
2024-03-04  1:26 ` [PULL 12/27] migration/ram: Add outgoing 'mapped-ram' migration peterx
2024-03-04  1:26 ` [PULL 13/27] migration/ram: Add incoming " peterx
2024-03-04  1:26 ` [PULL 14/27] tests/qtest/migration: Add tests for mapped-ram file-based migration peterx
2024-03-04  1:26 ` peterx [this message]
2024-03-04  1:26 ` [PULL 16/27] migration/multifd: Decouple recv method from pages peterx
2024-03-04  1:26 ` [PULL 17/27] migration/multifd: Allow multifd without packets peterx
2024-03-04  1:26 ` [PULL 18/27] migration/multifd: Allow receiving pages " peterx
2024-03-04  1:26 ` [PULL 19/27] migration/multifd: Add a wrapper for channels_created peterx
2024-03-04  1:26 ` [PULL 20/27] migration/multifd: Add outgoing QIOChannelFile support peterx
2024-03-04  1:26 ` [PULL 21/27] migration/multifd: Add incoming " peterx
2024-03-04  1:26 ` [PULL 22/27] migration/multifd: Prepare multifd sync for mapped-ram migration peterx
2024-03-04  1:26 ` [PULL 23/27] migration/multifd: Support outgoing mapped-ram stream format peterx
2024-03-04  1:26 ` [PULL 24/27] migration/multifd: Support incoming " peterx
2024-03-04  1:26 ` [PULL 25/27] migration/multifd: Add mapped-ram support to fd: URI peterx
2024-03-11 11:50   ` Peter Maydell
2024-03-11 11:54     ` Peter Maydell
2024-03-11 12:03   ` Daniel P. Berrangé
2024-03-11 13:30     ` Peter Xu
2024-03-04  1:26 ` [PULL 26/27] tests/qtest/migration: Add a multifd + mapped-ram migration test peterx
2024-03-04  1:26 ` [PULL 27/27] migration/multifd: Document two places for mapped-ram peterx
2024-03-05 13:44 ` [PULL 00/27] Migration next patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240304012634.95520-16-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=berrange@redhat.com \
    --cc=farosas@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).