[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/39] migration: Rename ram_handle_compressed() to ram_handle_zer
From: |
Juan Quintela |
Subject: |
[PULL 06/39] migration: Rename ram_handle_compressed() to ram_handle_zero() |
Date: |
Tue, 24 Oct 2023 15:12:32 +0200 |
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
- [PULL 00/39] Migration 20231024 patches, Juan Quintela, 2023/10/24
- [PULL 01/39] migration/doc: Add contents, Juan Quintela, 2023/10/24
- [PULL 02/39] migration/doc: Add documentation for backwards compatiblity, Juan Quintela, 2023/10/24
- [PULL 03/39] migration/doc: How to migrate when hosts have different features, Juan Quintela, 2023/10/24
- [PULL 05/39] migration: Receiving a zero page non zero is an error, Juan Quintela, 2023/10/24
- [PULL 04/39] migration/doc: We broke backwards compatibility, Juan Quintela, 2023/10/24
- [PULL 06/39] migration: Rename ram_handle_compressed() to ram_handle_zero(),
Juan Quintela <=
- [PULL 08/39] migration: Give one error if trying to set COMPRESSION and XBZRLE, Juan Quintela, 2023/10/24
- [PULL 09/39] migration: Remove save_page_use_compression(), Juan Quintela, 2023/10/24
- [PULL 12/39] migration: Move busy++ to migrate_with_multithread, Juan Quintela, 2023/10/24
- [PULL 10/39] migration: Make compress_data_with_multithreads return bool, Juan Quintela, 2023/10/24
- [PULL 13/39] migration: Create compress_update_rates(), Juan Quintela, 2023/10/24
- [PULL 14/39] migration: Export send_queued_data(), Juan Quintela, 2023/10/24
- [PULL 11/39] migration: Simplify compress_page_with_multithread(), Juan Quintela, 2023/10/24
- [PULL 16/39] migration: Merge flush_compressed_data() and compress_flush_data(), Juan Quintela, 2023/10/24
- [PULL 15/39] migration: Move ram_flush_compressed_data() to ram-compress.c, Juan Quintela, 2023/10/24
- [PULL 19/39] hw/s390x/s390-skeys: Don't call register_savevm_live() during instance_init(), Juan Quintela, 2023/10/24