<html><head><meta http-equiv="content-type" content="text/html; charset=GB2312"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }div.FoxDiv20210510150536599108 { }body { font-size: 14px; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span></div><blockquote style="margin-Top: 0px; margin-Bottom: 0px; margin-Left: 0.5em; margin-Right: inherit"><div class="FoxDiv20210510150536599108"><blockquote style="margin-Top: 0px; margin-Bottom: 0px; margin-Left: 0.5em; margin-Right: inherit"><div class="FoxDiv20210510132351290168"><div><div><div><div><span style="line-height: 1.5; background-color: transparent;">Hi Peter,</span></div><div><span style="line-height: 1.5; background-color: transparent;"><br></span></div><div>Since <a href="https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=7bfff40fdfe5410c446c1cd8ec413e00530faf7d">https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=7bfff40fdfe5410c446c1cd8ec413e00530faf7d</a>, </div><div>after blockcopy with pivot, a dirty-bitmap is added, but not been removed automatically.</div><div>Is that something wrong?</div><div><span style="background-color: transparent;"><br></span></div><div><span style="background-color: transparent;">0. start a vm, and switch on some traces</span></div><div><span style="background-color: transparent;"><div># virsh start cirros</div><div># virsh qemu-monitor-command cirros --hmp "trace-event handle_qmp* on"</div><div># virsh qemu-monitor-command cirros --hmp "trace-event hbitmap* on"</div></span></div><div><span style="line-height: 1.5; background-color: transparent;"><br></span></div><div><span style="line-height: 1.5; background-color: transparent;">1. cirros0.img is opened.</span></div><div><span style="line-height: 1.5; background-color: transparent;"># virsh domblklist cirros</span></div><div> Target   Source</div><div>------------------------------------</div><div> vda      /vms/images1/cirros0.img</div></div><div><br></div></div><div>2. blockcopy and pivot to cirros1.img</div><div># virsh blockcopy cirros vda --dest /vms/images1/cirros1.img --pivot --transient-job</div><div><span style="line-height: 1.5; background-color: transparent;">Successfully pivoted</span></div><div><br></div><div>3. cirros1.img is opened</div><div># virsh domblklist cirros</div><div> Target   Source</div><div>------------------------------------</div><div> vda      /vms/images1/cirros1.img</div></div><div><br></div><div>4. From qemu log<span style="line-height: 1.5; background-color: transparent;">, a </span><span style="line-height: 1.5; background-color: transparent;">dirty-bitmap is added </span><span style="line-height: 1.5; background-color: transparent;">@1620475221.389151</span></div><div><br></div>
<div><div>77998@1620475125.281656:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "human-monitor-command", "arguments": {"command-line": "trace-event qmp_job* on"}, "id": "libvirt-380"}</div><div>77998@1620475125.299950:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "human-monitor-command", "arguments": {"command-line": "trace-event mirror* on"}, "id": "libvirt-381"}</div><div>77998@1620475125.317931:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "human-monitor-command", "arguments": {"command-line": "trace-event hbitmap* on"}, "id": "libvirt-382"}</div><div>77998@1620475217.640133:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "query-named-block-nodes", "arguments": {"flat": true}, "id": "libvirt-383"}</div><div>77998@1620475217.642025:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "blockdev-add", "arguments": {"node-name": "libvirt-2-storage", "driver": "file", "filename": "/vms/images1/cirros1.img", "auto-read-only": true, "aio": "native", "cache": {"no-flush": false, "direct": true}, "discard": "unmap"}, "id": "libvirt-384"}</div><div>77998@1620475217.643434:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "blockdev-create", "arguments": {"job-id": "create-libvirt-2-format", "options": {"driver": "qcow2", "cluster-size": 65536, "size": 46137344, "file": "libvirt-2-storage"}}, "id": "libvirt-385"}</div><div>77998@1620475217.827378:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "query-jobs", "id": "libvirt-386"}</div><div>77998@1620475217.827980:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "job-dismiss", "arguments": {"id": "create-libvirt-2-format"}, "id": "libvirt-387"}</div><div>77998@1620475217.850802:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "blockdev-add", "arguments": {"backing": null, "node-name": "libvirt-2-format", "driver": "qcow2", "read-only": false, "cache": {"no-flush": false, "direct": true}, "file": "libvirt-2-storage"}, "id": "libvirt-388"}</div><div>77998@1620475217.853157:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "blockdev-mirror", "arguments": {"auto-finalize": true, "device": "libvirt-1-format", "auto-dismiss": false, "sync": "full", "job-id": "copy-vda-libvirt-1-format", "target": "libvirt-2-format"}, "id": "libvirt-389"}</div><div>77998@1620475217.871674:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "query-block-jobs", "id": "libvirt-390"}</div><div><span style="line-height: 1.5; background-color: transparent;">77998@1620475221.387625:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "query-block-jobs", "id": "libvirt-396"}</span></div><div>77998@1620475221.389151:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "transaction", "arguments": {"actions": [{"type": "block-dirty-bitmap-add", "data": {"name": "libvirt-tmp-activewrite", "persistent": false, "node": "libvirt-2-format", "disabled": false}}]}, "id": "libvirt-397"}</div><div>77998@1620475221.389755:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "job-complete", "arguments": {"id": "copy-vda-libvirt-1-format"}, "id": "libvirt-398"}</div><div>77998@1620475221.391321:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "query-jobs", "id": "libvirt-399"}</div><div>77998@1620475221.391926:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "job-dismiss", "arguments": {"id": "copy-vda-libvirt-1-format"}, "id": "libvirt-400"}</div><div>77998@1620475221.393052:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "blockdev-del", "arguments": {"node-name": "libvirt-1-format"}, "id": "libvirt-401"}</div><div>77998@1620475221.393702:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": "blockdev-del", "arguments": {"node-name": "libvirt-1-storage"}, "id": "libvirt-402"}</div></div><div>Also there are many hbitmap_xx events.</div><div><br></div><div>5. I have debuged the source, in <span style="line-height: 1.5; background-color: transparent;">qemuBlockJobProcessEventCompletedCopyBitmaps , </span><span style="background-color: transparent;">QEMU_CAPS_BLOCKDEV_REOPEN cap is not supported unti the latest qemu. </span></div><div><span style="background-color: transparent;">    So the bitmap is not removed.</span><span style="line-height: 1.5; background-color: transparent;"> Is the </span><span style="line-height: 1.5; background-color: transparent;">QEMU_CAPS_BLOCKDEV_REOPEN</span><span style="line-height: 1.5; background-color: transparent;"> cap be must?</span></div><div><br></div><div>Regards,</div><div>Chang Limin</div>
</div></blockquote>
</div></blockquote>
</body></html>