qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v2 2/3] virtio: support delay of checks in virtio_load()


From: Chuang Xu
Subject: Re: [RFC v2 2/3] virtio: support delay of checks in virtio_load()
Date: Tue, 13 Dec 2022 04:21:25 -0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.2


On 2022/12/13 上午4:18, Peter Xu wrote:
On Tue, Dec 13, 2022 at 12:49:41AM +0800, Chuang Xu wrote:
+bool migration_enable_load_check_delay;
I'm just afraid this is still too hacky.

One thing is because this variable itself to be only set at specific phase
during migration to cover that commit().  The other thing is I'm not sure
we can always rely on the commit() being happen 100% - what if there's no
memory layout changes throughout the whole process of vm load?  That'll be
skipped if memory_region_update_pending==false as I said.
Yes, you're right. I wanted to set memory_region_update_pending to true at 
the beginning of qemu_loadvm_state_main(), but somehow I forgot this detail..😭
So far the best I can come up with is we allow each virtio device to
register a vm state change handler (during virtio_load) to do the rest,
then in the handler it unregisters itself so it only runs once right before
the VM starts.  But I'm not sure whether the virtio developers will be
happy with it.  Maybe worth a try.

Feel free to have a look at like kvmvapic_vm_state_change() if you think
that idea worth exploring.
That's a good idea! 

But I don't think it's necessary to register a new vm state change handler. 
Maybe we just need to add a delay_check flag to VirtIODevice and do those 
delayed checks in virtio_vmstate_change() when delay_check is true.

Later I'll upload the v3 patches.

Thanks!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]