qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hao Xiang <hao.xiang@linux.dev>
To: pbonzini@redhat.com, berrange@redhat.com, eduardo@habkost.net,
	peterx@redhat.com, farosas@suse.de, eblake@redhat.com,
	armbru@redhat.com, thuth@redhat.com, lvivier@redhat.com,
	jdenemar@redhat.com, marcel.apfelbaum@gmail.com,
	philmd@linaro.org, wangyanan55@huawei.com, qemu-devel@nongnu.org
Subject: [PATCH v6 1/7] migration/multifd: Allow zero pages in file migration
Date: Mon, 11 Mar 2024 18:00:09 +0000	[thread overview]
Message-ID: <20240311180015.3359271-2-hao.xiang@linux.dev> (raw)
In-Reply-To: <20240311180015.3359271-1-hao.xiang@linux.dev>

From: Fabiano Rosas <farosas@suse.de>

Currently, it's an error to have no data pages in the multifd file
migration because zero page detection is done in the migration thread
and zero pages don't reach multifd. This is enforced with the
pages->num assert.

We're about to add zero page detection on the multifd thread. Fix the
file_write_ramblock_iov() to stop considering p->iovs_num=0 an error.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 migration/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/file.c b/migration/file.c
index 164b079966..5075f9526f 100644
--- a/migration/file.c
+++ b/migration/file.c
@@ -159,7 +159,7 @@ void file_start_incoming_migration(FileMigrationArgs *file_args, Error **errp)
 int file_write_ramblock_iov(QIOChannel *ioc, const struct iovec *iov,
                             int niov, RAMBlock *block, Error **errp)
 {
-    ssize_t ret = -1;
+    ssize_t ret = 0;
     int i, slice_idx, slice_num;
     uintptr_t base, next, offset;
     size_t len;
-- 
2.30.2



  reply	other threads:[~2024-03-11 18:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 18:00 [PATCH v6 0/7] Introduce multifd zero page checking Hao Xiang
2024-03-11 18:00 ` Hao Xiang [this message]
2024-03-11 18:00 ` [PATCH v6 2/7] migration/multifd: Allow clearing of the file_bmap from multifd Hao Xiang
2024-03-11 18:00 ` [PATCH v6 3/7] migration/multifd: Add new migration option zero-page-detection Hao Xiang
2024-03-11 18:00 ` [PATCH v6 4/7] migration/multifd: Implement zero page transmission on the multifd thread Hao Xiang
2024-03-11 20:18   ` Fabiano Rosas
2024-03-11 18:00 ` [PATCH v6 5/7] migration/multifd: Implement ram_save_target_page_multifd to handle multifd version of MigrationOps::ram_save_target_page Hao Xiang
2024-03-11 18:00 ` [PATCH v6 6/7] migration/multifd: Enable multifd zero page checking by default Hao Xiang
2024-03-11 20:41   ` Peter Xu
2024-03-11 20:44   ` Fabiano Rosas
2024-03-11 18:00 ` [PATCH v6 7/7] migration/multifd: Add new migration test cases for legacy zero page checking Hao Xiang
2024-03-11 20:59   ` Peter Xu
2024-03-11 20:43 ` [PATCH v6 0/7] Introduce multifd " Peter Xu

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=20240311180015.3359271-2-hao.xiang@linux.dev \
    --to=hao.xiang@linux.dev \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=farosas@suse.de \
    --cc=jdenemar@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=wangyanan55@huawei.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).