qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Eric Blake" <eblake@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Corey Minyard" <minyard@acm.org>,
	"Li Zhijian" <lizhijian@fujitsu.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Hanna Reitz" <hreitz@redhat.com>, "John Snow" <jsnow@redhat.com>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Corey Minyard" <cminyard@mvista.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Kevin Wolf" <kwolf@redhat.com>,
	qemu-s390x@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
	qemu-arm@nongnu.org, libvir-list@redhat.com,
	"Stefan Weil" <sw@weilnetz.de>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Leonardo Bras" <leobras@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>, "Fam Zheng" <fam@euphon.net>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
	"Samuel Thibault" <samuel.thibault@ens-lyon.org>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Juan Quintela" <quintela@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	qemu-ppc@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
	qemu-block@nongnu.org
Subject: [PULL 06/39] migration: Rename ram_handle_compressed() to ram_handle_zero()
Date: Tue, 24 Oct 2023 15:12:32 +0200	[thread overview]
Message-ID: <20231024131305.87468-7-quintela@redhat.com> (raw)
In-Reply-To: <20231024131305.87468-1-quintela@redhat.com>

Now that we know it only handles zero, we can remove the ch parameter.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231019085259.13307-3-quintela@redhat.com>
---
 migration/ram.h  |  2 +-
 migration/ram.c  | 10 +++++-----
 migration/rdma.c |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/migration/ram.h b/migration/ram.h
index 145c915ca7..3f724b2f02 100644
--- a/migration/ram.h
+++ b/migration/ram.h
@@ -60,7 +60,7 @@ int ram_discard_range(const char *block_name, uint64_t start, size_t length);
 int ram_postcopy_incoming_init(MigrationIncomingState *mis);
 int ram_load_postcopy(QEMUFile *f, int channel);
 
-void ram_handle_compressed(void *host, uint8_t ch, uint64_t size);
+void ram_handle_zero(void *host, uint64_t size);
 
 void ram_transferred_add(uint64_t bytes);
 void ram_release_page(const char *rbname, uint64_t offset);
diff --git a/migration/ram.c b/migration/ram.c
index 4bfb20c94a..e0ad732ee8 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3446,7 +3446,7 @@ static inline void *colo_cache_from_block_offset(RAMBlock *block,
 }
 
 /**
- * ram_handle_compressed: handle the zero page case
+ * ram_handle_zero: handle the zero page case
  *
  * If a page (or a whole RDMA chunk) has been
  * determined to be zero, then zap it.
@@ -3455,10 +3455,10 @@ static inline void *colo_cache_from_block_offset(RAMBlock *block,
  * @ch: what the page is filled from.  We only support zero
  * @size: size of the zero page
  */
-void ram_handle_compressed(void *host, uint8_t ch, uint64_t size)
+void ram_handle_zero(void *host, uint64_t size)
 {
-    if (ch != 0 || !buffer_is_zero(host, size)) {
-        memset(host, ch, size);
+    if (!buffer_is_zero(host, size)) {
+        memset(host, 0, size);
     }
 }
 
@@ -4037,7 +4037,7 @@ static int ram_load_precopy(QEMUFile *f)
                 ret = -EINVAL;
                 break;
             }
-            ram_handle_compressed(host, ch, TARGET_PAGE_SIZE);
+            ram_handle_zero(host, TARGET_PAGE_SIZE);
             break;
 
         case RAM_SAVE_FLAG_PAGE:
diff --git a/migration/rdma.c b/migration/rdma.c
index 2d963fd147..e3493e3b3e 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3597,7 +3597,7 @@ int rdma_registration_handle(QEMUFile *f)
                              comp->value);
                 goto err;
             }
-            ram_handle_compressed(host_addr, comp->value, comp->length);
+            ram_handle_zero(host_addr, comp->length);
             break;
 
         case RDMA_CONTROL_REGISTER_FINISHED:
-- 
2.41.0



  parent reply	other threads:[~2023-10-24 13:14 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 13:12 [PULL 00/39] Migration 20231024 patches Juan Quintela
2023-10-24 13:12 ` [PULL 01/39] migration/doc: Add contents Juan Quintela
2023-10-24 13:12 ` [PULL 02/39] migration/doc: Add documentation for backwards compatiblity Juan Quintela
2023-10-24 13:12 ` [PULL 03/39] migration/doc: How to migrate when hosts have different features Juan Quintela
2023-10-24 13:12 ` [PULL 04/39] migration/doc: We broke backwards compatibility Juan Quintela
2023-10-24 13:12 ` [PULL 05/39] migration: Receiving a zero page non zero is an error Juan Quintela
2023-10-24 13:12 ` Juan Quintela [this message]
2023-10-24 13:12 ` [PULL 07/39] migration: Give one error if trying to set MULTIFD and XBZRLE Juan Quintela
2023-10-24 13:12 ` [PULL 08/39] migration: Give one error if trying to set COMPRESSION " Juan Quintela
2023-10-24 13:12 ` [PULL 09/39] migration: Remove save_page_use_compression() Juan Quintela
2023-10-24 13:12 ` [PULL 10/39] migration: Make compress_data_with_multithreads return bool Juan Quintela
2023-10-24 13:12 ` [PULL 11/39] migration: Simplify compress_page_with_multithread() Juan Quintela
2023-10-24 13:12 ` [PULL 12/39] migration: Move busy++ to migrate_with_multithread Juan Quintela
2023-10-24 13:12 ` [PULL 13/39] migration: Create compress_update_rates() Juan Quintela
2023-10-24 13:12 ` [PULL 14/39] migration: Export send_queued_data() Juan Quintela
2023-10-24 13:12 ` [PULL 15/39] migration: Move ram_flush_compressed_data() to ram-compress.c Juan Quintela
2023-10-24 13:12 ` [PULL 16/39] migration: Merge flush_compressed_data() and compress_flush_data() Juan Quintela
2023-10-24 13:12 ` [PULL 17/39] migration: Rename ram_compressed_pages() to compress_ram_pages() Juan Quintela
2023-10-24 13:12 ` [PULL 18/39] hw/ipmi: Don't call vmstate_register() from instance_init() functions Juan Quintela
2023-10-24 13:12 ` [PULL 19/39] hw/s390x/s390-skeys: Don't call register_savevm_live() during instance_init() Juan Quintela
2023-10-26 15:35   ` Thomas Huth
2023-10-24 13:12 ` [PULL 20/39] hw/s390x/s390-stattrib: Simplify handling of the "migration-enabled" property Juan Quintela
2023-10-26 15:37   ` Thomas Huth
2023-10-24 13:12 ` [PULL 21/39] hw/s390x/s390-stattrib: Don't call register_savevm_live() during instance_init() Juan Quintela
2023-10-24 13:12 ` [PULL 22/39] migration/ram: Fix compilation with -Wshadow=local Juan Quintela
2023-10-24 13:12 ` [PULL 23/39] migration: rename vmstate_save_needed->vmstate_section_needed Juan Quintela
2023-10-24 13:12 ` [PULL 24/39] migration: set file error on subsection loading Juan Quintela
2023-10-24 13:12 ` [PULL 25/39] migration: Create vmstate_register_any() Juan Quintela
2023-10-24 13:12 ` [PULL 26/39] migration: Use vmstate_register_any() Juan Quintela
2023-10-24 13:12 ` [PULL 27/39] migration: Use vmstate_register_any() for isa-ide Juan Quintela
2023-10-24 13:12 ` [PULL 28/39] migration: Use VMSTATE_INSTANCE_ID_ANY for slirp Juan Quintela
2023-10-24 13:12 ` [PULL 29/39] migration: Hack to maintain backwards compatibility for ppc Juan Quintela
2023-10-24 13:12 ` [PULL 30/39] migration: Check in savevm_state_handler_insert for dups Juan Quintela
2023-10-24 13:12 ` [PULL 31/39] migration: Improve example and documentation of vmstate_register() Juan Quintela
2023-10-24 13:12 ` [PULL 32/39] migration: Use vmstate_register_any() for audio Juan Quintela
2023-10-24 13:12 ` [PULL 33/39] migration: Use vmstate_register_any() for eeprom93xx Juan Quintela
2023-10-24 13:13 ` [PULL 34/39] migration: Use vmstate_register_any() for vmware_vga Juan Quintela
2023-10-24 13:13 ` [PULL 35/39] qemu-iotests: Filter warnings about block migration being deprecated Juan Quintela
2023-10-24 13:13 ` [PULL 36/39] migration: migrate 'inc' command option is deprecated Juan Quintela
2023-10-24 13:13 ` [PULL 37/39] migration: migrate 'blk' " Juan Quintela
2023-10-24 13:13 ` [PULL 38/39] migration: Deprecate block migration Juan Quintela
2023-10-24 13:13 ` [PULL 39/39] migration: Deprecate old compression method Juan Quintela
2023-10-26  0:50 ` [PULL 00/39] Migration 20231024 patches Stefan Hajnoczi
2023-10-26 15:25   ` Juan Quintela
2023-10-27  0:41     ` Stefan Hajnoczi

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=20231024131305.87468-7-quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=armbru@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=clg@kaod.org \
    --cc=cminyard@mvista.com \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=farman@linux.ibm.com \
    --cc=farosas@suse.de \
    --cc=harshpb@linux.ibm.com \
    --cc=hreitz@redhat.com \
    --cc=iii@linux.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=leobras@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=lizhijian@fujitsu.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=minyard@acm.org \
    --cc=mst@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=pasic@linux.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=stefanha@redhat.com \
    --cc=sw@weilnetz.de \
    --cc=thuth@redhat.com \
    /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).