From: Avihai Horon <avihaih@nvidia.com>
To: <qemu-devel@nongnu.org>
Cc: "Alex Williamson" <alex.williamson@redhat.com>,
"Cédric Le Goater" <clg@redhat.com>,
"Peter Xu" <peterx@redhat.com>, "Fabiano Rosas" <farosas@suse.de>,
"Wang, Lei" <lei4.wang@intel.com>,
"Joao Martins" <joao.m.martins@oracle.com>,
"Avihai Horon" <avihaih@nvidia.com>
Subject: [PATCH v2 2/3] vfio/migration: Refactor vfio_save_state() return value
Date: Mon, 4 Mar 2024 12:53:38 +0200 [thread overview]
Message-ID: <20240304105339.20713-3-avihaih@nvidia.com> (raw)
In-Reply-To: <20240304105339.20713-1-avihaih@nvidia.com>
Currently, vfio_save_state() returns 1 regardless of whether there is
more data to send or not. This was done to prevent a fast changing VFIO
device from potentially blocking other devices from sending their data,
as qemu_savevm_state_iterate() serialized devices.
Now that qemu_savevm_state_iterate() no longer serializes devices, there
is no need for that.
Refactor vfio_save_state() to return 0 if more data is available and 1
if no more data is available.
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
---
hw/vfio/migration.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 50140eda872..0af783a5892 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -529,11 +529,7 @@ static int vfio_save_iterate(QEMUFile *f, void *opaque)
trace_vfio_save_iterate(vbasedev->name, migration->precopy_init_size,
migration->precopy_dirty_size);
- /*
- * A VFIO device's pre-copy dirty_bytes is not guaranteed to reach zero.
- * Return 1 so following handlers will not be potentially blocked.
- */
- return 1;
+ return !migration->precopy_init_size && !migration->precopy_dirty_size;
}
static int vfio_save_complete_precopy(QEMUFile *f, void *opaque)
--
2.26.3
next prev parent reply other threads:[~2024-03-04 10:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 10:53 [PATCH v2 0/3] migration: Don't serialize devices in qemu_savevm_state_iterate() Avihai Horon
2024-03-04 10:53 ` [PATCH v2 1/3] " Avihai Horon
2024-03-04 10:53 ` Avihai Horon [this message]
2024-03-04 10:53 ` [PATCH v2 3/3] vfio/migration: Add a note about migration rate limiting Avihai Horon
2024-03-04 20:36 ` [PATCH v2 0/3] migration: Don't serialize devices in qemu_savevm_state_iterate() Fabiano Rosas
2024-03-05 2:24 ` 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=20240304105339.20713-3-avihaih@nvidia.com \
--to=avihaih@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=clg@redhat.com \
--cc=farosas@suse.de \
--cc=joao.m.martins@oracle.com \
--cc=lei4.wang@intel.com \
--cc=peterx@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).