[pve-devel] [PATCH v1 pve-qemu 1/1] add block-commit-replaces option patch

Fiona Ebner f.ebner at proxmox.com
Mon Jan 13 15:28:25 CET 2025


Am 10.01.25 um 10:32 schrieb DERUMIER, Alexandre:
>>> Maybe it could even be a bug then? 
> 
> Yes, it's a bug.  I just think that libvirt currently only implement 
> block-commit with disk blockdev on topnode.
> 
> throttle group are not currently implement in libvirt (but I have seen
> some commit to add support recently), they still used the old throttle
> method.
> 
>>> In many situations, the filter >>nodes
>>> on top (like throttle groups) are ignored/skipped to get to the
>>> actually
>>> interesting block node for certain block operations. 
> 
> yes, and this option exist in the qmp blockdev-mirror.   (and block-
> commit is reusing blockdev-mirror code behind)
> 
> 
>>> Are there any situations where you wouldn't want to do that in the
>>> block-commit case?
> mmm, I think it should always be rettach to disk (format blocknode or
> file blocknode if no formatnode exist). I really don't known how to
> code this, I have just reused the blockdev-mirror way.
> 
> 
> Feel free to cleanup this patch and submit it to qemu devs, you are a
> better C developper than me ^_^

I can try to look into it, but could you give some more details how
exactly the issue manifests? What parameters are you using for
block-commit, how does the graph look like at the time of the operation?
What error do you get without your patch or what exactly does not work
in the block graph?

My first try did not result in an error:

> #!/bin/bash
> rm -f /tmp/backing.qcow2
> rm -f /tmp/top.qcow2
> qemu-img create /tmp/backing.qcow2 -f qcow2 64M
> qemu-img create /tmp/top.qcow2 -f qcow2 64M
> qemu-system-x86_64 --qmp stdio \
> --nodefaults \
> --object throttle-group,id=thrgr0 \
> --blockdev qcow2,node-name=backing0,file.driver=file,file.filename=/tmp/backing.qcow2 \
> --blockdev throttle,node-name=drive-scsi0,throttle-group=thrgr0,file.driver=qcow2,file.node-name=node0,file.file.driver=file,file.file.filename=/tmp/top.qcow2,file.backing=backing0 \
> --device 'virtio-scsi-pci,id=virtioscsi0,bus=pci.0,addr=0x2' \
> --device 'scsi-hd,bus=virtioscsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0' \
> <<EOF
> {"execute": "qmp_capabilities"}
> {"execute": "query-block"}
> {"execute": "block-commit", "arguments": { "device": "drive-scsi0", "top-node": "node0", "base-node": "backing0", "job-id": "commit0" } }
> {"execute": "query-block"}
> {"execute": "quit"}
> EOF





More information about the pve-devel mailing list