On 10/28/24 16:50, Peter Xu wrote:
On Fri, Oct 25, 2024 at 02:50:36PM +0200, Cédric Le Goater wrote:
On 10/24/24 23:30, Peter Xu wrote:
Introduce migration_mutex, protecting concurrent updates to
current_migration.
In reality, most of the exported migration functions are safe to access
migration objects on capabilities, etc., e.g. many of the code is invoked
within migration thread via different hooks (e.g., precopy notifier,
vmstate handler hooks, etc.).
So literally the mutex so far only makes sure below two APIs that are prone
to accessing freed current_migration:
migration_is_running()
migration_file_set_error()
Then we'll need to take the mutex too when init/free the migration object.
we should also drop :
static void vfio_set_migration_error(int ret)
{
if (migration_is_running()) {
migration_file_set_error(ret, NULL);
}
}
and use directly migration_file_set_error().
We'll need to export migration_is_running() anyway, though. So maybe we
can do that as a VFIO's follow up?
sure. Let's add that to the list, along with the 'log_enabled' bool that
you discussed with Avihai in the previous patch :
[PATCH v3 7/8] migration: Unexport migration_is_active()
These changes would be good to have in QEMU 9.2.
Avihai, I have access to HW supporting HW dirty tracking.
Thanks,
C.