diff options
author | Hao Xiang <hao.xiang@bytedance.com> | 2024-03-11 18:00:11 +0000 |
---|---|---|
committer | Peter Xu <peterx@redhat.com> | 2024-03-11 16:57:05 -0400 |
commit | 5fdbb1dfccfd59661c95cae760b8e276c5b8e65c (patch) | |
tree | 3d8b915fe3da3f2cdc549dd0614d544ed114e067 /migration/ram.c | |
parent | c3cdf3fb18e5ecf8a3b4dc7223ddbfc53c418eb8 (diff) | |
download | qemu-5fdbb1dfccfd59661c95cae760b8e276c5b8e65c.zip qemu-5fdbb1dfccfd59661c95cae760b8e276c5b8e65c.tar.gz qemu-5fdbb1dfccfd59661c95cae760b8e276c5b8e65c.tar.bz2 |
migration/multifd: Add new migration option zero-page-detection.
This new parameter controls where the zero page checking is running.
1. If this parameter is set to 'legacy', zero page checking is
done in the migration main thread.
2. If this parameter is set to 'none', zero page checking is disabled.
Signed-off-by: Hao Xiang <hao.xiang@bytedance.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Link: https://lore.kernel.org/r/20240311180015.3359271-4-hao.xiang@linux.dev
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/ram.c')
-rw-r--r-- | migration/ram.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/migration/ram.c b/migration/ram.c index dec2e73..260529f 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1140,6 +1140,10 @@ static int save_zero_page(RAMState *rs, PageSearchStatus *pss, QEMUFile *file = pss->pss_channel; int len = 0; + if (migrate_zero_page_detection() == ZERO_PAGE_DETECTION_NONE) { + return 0; + } + if (!buffer_is_zero(p, TARGET_PAGE_SIZE)) { return 0; } |