Bug 1929765

Summary: Adapt to differences of 'blockdev-reopen' implementations
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Peter Krempa <pkrempa>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Han Han <hhan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: aliang, coli, jdenemar, lmen, ngu, virt-maint, xuzhang
Target Milestone: rcKeywords: Triaged
Target Release: 8.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-7.6.0-1.module+el8.5.0+12097+2c77910b Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 07:51:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Krempa 2021-02-17 15:36:41 UTC
Description of problem:
We've already enabled blockdev-reopen downstream, but upstream will likely change the API slightly. The downstream-only patch enabling it needs to be adapted to work on top of the new upstream code while keeping compatibility with the already present downstream implementation.

Comment 1 Peter Krempa 2021-04-13 08:22:38 UTC
rhel-av-8.5 will use qemu-6.0 which didn't adopt the upstream 'blockdev-reopen' yet, so we'll stick with the downstream version. Moving to 8.6

Comment 6 Han Han 2021-08-27 09:21:16 UTC
Verified on libvirt-7.6.0-2.module+el8.5.0+12219+a5ea13d2.x86_64 qemu-kvm-6.0.0-29.module+el8.5.0+12386+43574bac.x86_64:
1.Create checkpoint
# virsh checkpoint-create-as rhel9 c1
Domain checkpoint c1 created

2. Create disk-only snapshot
# virsh snapshot-create-as rhel9 s1 --no-metadata --disk-only --reuse-external                                                                                                            
Domain snapshot s1 created


3. Remove checkpoint c1:
# virsh checkpoint-delete rhel9 c1
Domain checkpoint c1 deleted

The qmp of step3:
1482.216 > 0x7ffb2004b060 {"execute":"query-named-block-nodes","arguments":{"flat":true},"id":"libvirt-447"}                                                                                 
1482.219 < 0x7ffb2004b060 {"return": [{"iops_rd": 0, "detect_zeroes": "off", "image": {"backing-filename-format": "qcow2", "virtual-size": 10737418240, "filename": "/var/lib/libvirt/images/rhel9.s1", "cluster-size": 65536, "format": "qcow2", "actual-size": 2105344, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "compression-type": "zlib", "lazy-refcounts": false, "bitmaps": [{"flags": ["in-use", "auto"], "name": "s12", "granularity": 65536}], "refcount-bits": 16, "corrupt": false, "extended-l2": fal                                                 
1482.227 > 0x7ffb2004b060 {"execute":"x-blockdev-reopen","arguments":{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage","backing":null},"id":"libvirt-448"}
1482.237 < 0x7ffb2004b060 {"return": {}, "id": "libvirt-448"}
1482.237 > 0x7ffb2004b060 {"execute":"transaction","arguments":{"actions":[{"type":"block-dirty-bitmap-remove","data":{"node":"libvirt-5-format","name":"c1"}},{"type":"block-dirty-bitmap-remove","data":{"node":"libvirt-1-format","name":"c1"}}]},"id":"libvirt-449"}
1482.242 < 0x7ffb2004b060 {"return": {}, "id": "libvirt-449"}
1482.242 > 0x7ffb2004b060 {"execute":"x-blockdev-reopen","arguments":{"node-name":"libvirt-1-format","read-only":true,"driver":"qcow2","file":"libvirt-1-storage","backing":null},"id":"libvirt-450"}
1482.247 < 0x7ffb2004b060 {"return": {}, "id": "libvirt-450"}


"x-blockdev-reopen" is implemented.

Comment 8 errata-xmlrpc 2021-11-16 07:51:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4684