Re: After blockcopy with pivot, a dirty-bitmap is added, but not been removed automatically.

2021-05-12 Thread ChangLimin
>On Mon, May 10, 2021 at 13:34:41 +0800, ChangLimin wrote:
>> Hi Peter,
>>
>> Since 
>> https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=7bfff40fdfe5410c446c1cd8ec413e00530faf7d,
>> after blockcopy with pivot, a dirty-bitmap is added, but not been removed 
>> automatically.
>> Is that something wrong?
>
>Yeah, it's a bug and it should be removed. I'll have a look.
> 

Can this patch fix the bug? 

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index faf9a9fb7d..15dabe2c23 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -1338,7 +1338,8 @@ qemuBlockJobProcessEventCompletedCopyBitmaps(virDomainObj 
*vm,
     g_autoptr(virJSONValue) actions = NULL;
     bool shallow = job->jobflags & VIR_DOMAIN_BLOCK_COPY_SHALLOW;

-    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN))
+    if (job->disk->src->readonly &&
+        !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN))
         return 0;




After blockcopy with pivot, a dirty-bitmap is added, but not been removed automatically.

2021-05-10 Thread ChangLimin
Hi Peter,

Since 
https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=7bfff40fdfe5410c446c1cd8ec413e00530faf7d,
 
after blockcopy with pivot, a dirty-bitmap is added, but not been removed 
automatically.
Is that something wrong?

0. start a vm, and switch on some traces
# virsh start cirros
# virsh qemu-monitor-command cirros --hmp "trace-event handle_qmp* on"
# virsh qemu-monitor-command cirros --hmp "trace-event hbitmap* on"

1. cirros0.img is opened.
# virsh domblklist cirros
 Target   Source

 vda  /vms/images1/cirros0.img

2. blockcopy and pivot to cirros1.img
# virsh blockcopy cirros vda --dest /vms/images1/cirros1.img --pivot 
--transient-job
Successfully pivoted

3. cirros1.img is opened
# virsh domblklist cirros
 Target   Source

 vda  /vms/images1/cirros1.img

4. From qemu log, a dirty-bitmap is added @1620475221.389151

77998@1620475125.281656:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"human-monitor-command", "arguments": {"command-line": "trace-event qmp_job* 
on"}, "id": "libvirt-380"}
77998@1620475125.299950:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"human-monitor-command", "arguments": {"command-line": "trace-event mirror* 
on"}, "id": "libvirt-381"}
77998@1620475125.317931:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"human-monitor-command", "arguments": {"command-line": "trace-event hbitmap* 
on"}, "id": "libvirt-382"}
77998@1620475217.640133:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"query-named-block-nodes", "arguments": {"flat": true}, "id": "libvirt-383"}
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"}
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"}
77998@1620475217.827378:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"query-jobs", "id": "libvirt-386"}
77998@1620475217.827980:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"job-dismiss", "arguments": {"id": "create-libvirt-2-format"}, "id": 
"libvirt-387"}
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"}
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"}
77998@1620475217.871674:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"query-block-jobs", "id": "libvirt-390"}
77998@1620475221.387625:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"query-block-jobs", "id": "libvirt-396"}
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"}
77998@1620475221.389755:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"job-complete", "arguments": {"id": "copy-vda-libvirt-1-format"}, "id": 
"libvirt-398"}
77998@1620475221.391321:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"query-jobs", "id": "libvirt-399"}
77998@1620475221.391926:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"job-dismiss", "arguments": {"id": "copy-vda-libvirt-1-format"}, "id": 
"libvirt-400"}
77998@1620475221.393052:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"blockdev-del", "arguments": {"node-name": "libvirt-1-format"}, "id": 
"libvirt-401"}
77998@1620475221.393702:handle_qmp_command mon 0x55ebd4b176b0 req: {"execute": 
"blockdev-del", "arguments": {"node-name": "libvirt-1-storage"}, "id": 
"libvirt-402"}
Also there are many hbitmap_xx events.

5. I have debuged the source, in qemuBlockJobProcessEventCompletedCopyBitmaps , 
QEMU_CAPS_BLOCKDEV_REOPEN cap is not supported unti the latest qemu. 
So the bitmap is not removed. Is the QEMU_CAPS_BLOCKDEV_REOPEN cap be must?

Regards,
Chang Limin


[libvirt] PCI domain space need be enlarge to support domain great than FFFF

2019-07-29 Thread Changlimin
For some servers, PCI domain is great than 

# lspci
1:00:00.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port A 
(rev 04)
1:00:01.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port B 
(rev 04)
1:00:02.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port C 
(rev 04)
1:00:03.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port D 
(rev 04)
1:01:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe 
SSD Controller SM961/PM961
1:02:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe 
SSD Controller SM961/PM961

So some code need to match the larger domain.

#define PCI_ADDR_LEN 13 /* ":XX:XX.X" */

snprintf(dev->name, sizeof(dev->name), "%.4x:%.2x:%.2x.%.1x",
 domain, bus, slot, function)

if (addr->domain > 0x) {

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Some windows hyperv features cannot be enabled after the patch 63acb7bfd56f117309e4fcaf438639d4d7bc7dcb

2019-07-29 Thread Changlimin
When using with QEMU 
v4.1.0-rc0 or newer, the 
patch 
https://libvirt.org/git/?p=libvirt.git;a=commit;h=63acb7bfd56f117309e4fcaf438639d4d7bc7dcb
 cause some windows hyperv features cannot be enabled.

# virsh start win10
error: Failed to start domain win10
error: unsupported configuration: host doesn't support hyperv 'vpindex' feature

  

  
  
  
  
  
  
  
  
  
  
  
  


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list