Bug 1993308

Summary: qemu-img convert --bitmaps fail if a bitmap is inconsistent [rhel-8.4.0.z]
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: RHEL Program Management Team <pgm-rhel-tools>
Component: qemu-kvmAssignee: Eric Blake <eblake>
qemu-kvm sub component: Incremental Live Backup QA Contact: aihua liang <aliang>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: aliang, coli, eblake, jinzhao, juzhang, kkiwi, leidwang, ngu, nsoffer, timao, virt-maint, xuwei, ymankad
Version: 8.3Keywords: Regression, Triaged, ZStream
Target Milestone: rc   
Target Release: 8.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-5.2.0-16.module+el8.4.0+13043+9eb47245.11 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1946084 Environment:
Last Closed: 2021-11-03 08:47:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1946084    
Bug Blocks:    

Comment 1 Klaus Heinrich Kiwi 2021-08-24 17:44:08 UTC
Eric, can you post the backport to 8.4.z?

Thanks

Comment 2 CongLi 2021-09-18 02:30:54 UTC
Hi Eric,

Can you please confirm which batch update this bug will be targeted for?

Thanks.

Comment 3 Nir Soffer 2021-09-19 11:58:14 UTC
We need to know if this will be available in the next 8.4.z update, so we can
require a version with the fix for RHV 4.4.9.

Comment 4 Eric Blake 2021-09-20 20:46:11 UTC
Patches posted downstream:
https://mailman-int.corp.redhat.com/archives/rhvirt-patches/2021-September/msg00069.html

Comment 8 aihua liang 2021-10-25 09:28:29 UTC
Test on qemu-kvm-5.2.0-16.module+el8.4.0+13043+9eb47245.11, the problem has been resolved.

Test Env:
  Kernel version:4.18.0-305.el8.x86_64
  qemu-kvm version:qemu-kvm-5.2.0-16.module+el8.4.0+13043+9eb47245.11

Test Steps:
 1.Create a qcow2 image
   #qemu-img create -f qcow2 /home/data.qcow2 2G

 2.Add a persistent bitmap offline
   #qemu-img bitmap /home/data.qcow2 --add bitmap_persistent

 3.Expose the persistent bitmap via qemu-nbd
   #qemu-nbd -t -p 10098 /home/data.qcow2 -B bitmap_persistent

 4.Kill qemu-nbd
   #kill -9 $pid_qemu_nbd

 5.Check image info of data.qcow2
   # qemu-img info /home/data.qcow2 
image: /home/data.qcow2
file format: qcow2
virtual size: 2 GiB (2147483648 bytes)
disk size: 324 KiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    bitmaps:
        [0]:
            flags:
                [0]: in-use
                [1]: auto
            name: bitmap_persistent
            granularity: 65536
    refcount bits: 16
    corrupt: false
    extended l2: false

  6.Add a new persistent bitmap to /home/data.qcow2
    #qemu-img bitmap /home/data.qcow2 --add bitmap_add

  7.Check image info of /home/data.qcow2
    #qemu-img info /home/data.qcow2 
image: /home/data.qcow2
file format: qcow2
virtual size: 2 GiB (2147483648 bytes)
disk size: 452 KiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    bitmaps:
        [0]:
            flags:
                [0]: in-use
                [1]: auto
            name: bitmap_persistent
            granularity: 65536
        [1]:
            flags:
                [0]: auto
            name: bitmap_add
            granularity: 65536
    refcount bits: 16
    corrupt: false
    extended l2: false

 8.Convert image with all bitmaps
   #qemu-img convert -O qcow2 /home/data.qcow2 /home/test/data_new.qcow2 --bitmaps
qemu-img: Cannot copy inconsistent bitmap 'bitmap_persistent'
Try --skip-broken-bitmaps, or use 'qemu-img bitmap --remove' to delete it

 9.Convert image with inconsistent bitmap skipped.
   #qemu-img convert -O qcow2 /home/data.qcow2 /home/test/data_new.qcow2 --bitmaps --skip-broken-bitmaps
qemu-img: warning: Skipping inconsistent bitmap 'bitmap_persistent'

 10.Check image info of converted image
   #qemu-img info /home/test/data_new.qcow2 
image: /home/test/data_new.qcow2
file format: qcow2
virtual size: 2 GiB (2147483648 bytes)
disk size: 324 KiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    bitmaps:
        [0]:
            flags:
                [0]: auto
            name: bitmap_add
            granularity: 65536
    refcount bits: 16
    corrupt: false
    extended l2: false

Comment 10 errata-xmlrpc 2021-11-03 08:47:19 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 (Moderate: virt:av and virt-devel:av security and bug fix 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/RHSA-2021:4112