<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }body { font-size: 14px; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span><br></div><div>Hi, Peter</div><div><br></div><div><span style="color: rgb(25, 25, 25); font-family: 'PingFang SC', Arial, 微软雅黑, 宋体, simsun, sans-serif; font-size: 16px; font-variant-ligatures: normal; orphans: 2; widows: 2;">I really appreciate it.</span></div><div><span style="color: rgb(25, 25, 25); font-family: 'PingFang SC', Arial, 微软雅黑, 宋体, simsun, sans-serif; font-size: 16px; font-variant-ligatures: normal; orphans: 2; widows: 2;"><br></span></div><div>Thank you!</div><div><br></div>
<div><br></div><hr style="width: 210px; height: 1px; display: none;" color="#b5c4df" size="1" align="left">
<div><span></span></div>
<blockquote style="margin-Top: 0px; margin-Bottom: 0px; margin-Left: 0.5em; margin-Right: inherit"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:pkrempa@redhat.com">Peter Krempa</a></div><div><b>Date:</b> 2021-09-06 14:37</div><div><b>To:</b> <a href="mailto:guozh88@chinatelecom.cn">Guozhonghua</a></div><div><b>CC:</b> <a href="mailto:libvirt-users@redhat.com">libvirt-users</a></div><div><b>Subject:</b> Re: one qustion about the snapshot of the libvirt, thanks.</div></div></div><div><div>On Tue, Aug 31, 2021 at 16:09:50 +0800, Guozhonghua wrote:</div>
<div>> </div>
<div>> Hello, </div>
<div>> </div>
<div>> When we test snapshot features and review the code of libvirt, there is one question, not an issue. </div>
<div>> </div>
<div>>     /* do the memory snapshot if necessary */</div>
<div>>     if (memory) {</div>
<div>>         /* check if migration is possible */</div>
<div>>         if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0))</div>
<div>>             goto cleanup;</div>
<div>> </div>
<div>> 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.</div>
<div>> I want to known the reason, why should  it check this conditions? </div>
<div> </div>
<div>The reason for this check is that the state of host devices namely PCI</div>
<div>devices can't be serialized by qemu and saved in the snapshot. That</div>
<div>means that when reverting the devices would not be configured properly</div>
<div>and would not work.</div>
<div> </div>
<div>Internally qemu and libvirt use the migration code to serialize the</div>
<div>state of the VM and that is the reason why 'qemuMigrationSrcIsAllowed'</div>
<div>is called here, because it uses the same implementation.</div>
<div> </div>
<div> </div>
</div></blockquote>
</body></html>