Hi, Peter
I really appreciate it.
Thank you!
From: Peter KrempaDate: 2021-09-06 14:37To: GuozhonghuaCC: libvirt-usersSubject: Re: one qustion about the snapshot of the libvirt, thanks.On Tue, Aug 31, 2021 at 16:09:50 +0800, Guozhonghua wrote:>> Hello,>> When we test snapshot features and review the code of libvirt, there is one question, not an issue.>> /* do the memory snapshot if necessary */> if (memory) {> /* check if migration is possible */> if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0))> goto cleanup;>> While making one snapshot with memory on one vm, but it is not allowed while the vm which has some src devices, such as pci devs, with which the vm is not allowed to be migrated.> I want to known the reason, why should it check this conditions?The reason for this check is that the state of host devices namely PCIdevices can't be serialized by qemu and saved in the snapshot. Thatmeans that when reverting the devices would not be configured properlyand would not work.Internally qemu and libvirt use the migration code to serialize thestate of the VM and that is the reason why 'qemuMigrationSrcIsAllowed'is called here, because it uses the same implementation.