On 5/23/22 07:11, Avihai Horon wrote:
> On 5/20/2022 1:58 PM, Joao Martins wrote:
>>> + migrate_get_current()->skip_precopy = true;
>>> + }
>>> +
>> Perhaps it might be easier to reuse the existing knob to disable pre-copy
>> per device that Kirti added some time ago, rather than changing migration
>> core just
>> yet (e.g. you might wanna bail of the migration preemptively because the CPU
>> is dirtying
>> too many pages for example?):
>>
>> if (!container->dirty_pages_supported) {
>> warn_report_once(...)
>> pre_copy_dirty_page_tracking = ON_OFF_AUTO_OFF;
>> }
>
> But this doesn't prevent the VFIO device from dirtying RAM pages during
> pre-copy phase.
> The VFIO device can dirty RAM pages during pre-copy and it won't have a
> way to report the dirtied pages to QEMU and migration will be faulty.
>
You're quite right, sorry for the noise. I was a little too obsessed in reusing
the
existing field that forgot that letting the iterate stage go the PCI device
could
also be driven into dirtying RAM too.