On 7/18/22 11:15 AM, Jiri Denemark wrote:
On Mon, Jul 18, 2022 at 10:40:56 +0200, Eugenio Perez Martin wrote:
> On Mon, Jul 18, 2022 at 10:25 AM Jiri Denemark <jdenemar(a)redhat.com> wrote:
>> Which in ideal case would mean only a QMP command (such as
>> hotplugging a non-migratable device) is the only way to add migration
>> blocker. If this is true, than we're safe as libvirt does not allow such
>> commands between qemuMigrationSrcIsAllowed and migration start.
>>
>
> Ok, that rules out a few bad use cases. I can do a fast lookup to
> check if blockers can be added without the knowledge of libvirt.
>
>> That said, is there a reason for not implementing the correct solution
>> right away as a separate patch?
>>
>
> I was not sure if libvirt already had another way to check, for
> example, if the vhost device didn't have VHOST_F_LOG_ALL feature.
I'm not aware of such check, but even if it exists, checking for
migration blockers looks like the right way of doing things anyway.
Actually that's been on my todo list for a long time - for any qemu that
supports the QMP command that checks for migratability, we should be
calling this command rather than checking against our own internal list
(which is really just an "informed guess") of what can't be migrated.
This way we'll always get the right answer (or at least what QEMU
believes to be the right answer :-)). Fixing it this way will also mean
that migration of VFIO devices will just "magically" start working once
a migration-supporting driver is written for the device, and the correct
vfio driver is bound to the device (this latter item is also on my list).
So if you're up for making the patch to call the QMP command, I'd be
happy to review it!