Bug 1780359

Summary: RFE: Add bitmap size measurement for existing images
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: John Snow <jsnow>
Component: qemu-kvmAssignee: John Snow <jsnow>
qemu-kvm sub component: Incremental Live Backup QA Contact: aihua liang <aliang>
Status: CLOSED DUPLICATE Docs Contact:
Severity: unspecified    
Priority: medium CC: coli, eblake, jinzhao, juzhang, nsoffer, timao, virt-maint, ymankad
Version: 8.4Keywords: FutureFeature, Triaged
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-16 21:38:03 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Snow 2019-12-05 18:41:49 UTC
Description of problem:

qemu-img info (or indeed, any other form of query on qcow2 images in either QMP or qemu-img) has no accounting for the current concrete sizes necessitated by bitmaps in an image.

RHV would like to have this information to be able to anticipate filesizes when converting/copying images.


Expected results:

The ability to measure the cost impact of bitmaps in a qcow2 image.

Comment 2 Ademar Reis 2020-02-05 23:09:59 UTC
QEMU has been recently split into sub-components and as a one-time operation to avoid breakage of tools, we are setting the QEMU sub-component of this BZ to "General". Please review and change the sub-component if necessary the next time you review this BZ. Thanks

Comment 3 Nir Soffer 2020-04-16 21:00:28 UTC
I think what we need is something like:

    qemu-img measure -f qcow2 -O qcow2 --bitmaps src.qcow2

This will include the bitmaps in src.qcow2 when reporting the required size,
so:

    lvcreate --size require_size --name lv-name vg-name
    qemu-img create -f qcow2 /dev/vg-name/lv-name 10g
    qemu-img convert -n -f qcow2 -O qcow2 --bitmaps src.qcow2 /dev/vg-name/lv-name

Will copy the image and the bitmaps successfully to the target image.

The current way to do this is to run:

    qemu-img info --output json src.qcow2

Then collect all the bitmaps under "bitmaps" and assuming that all bitmaps conver
the entire image, and calculate the size of the bitmap based on granularity, and 
some extra space for the metadata overhead mentioned in comment 0.

Related discussion in qemu-block:
https://lists.nongnu.org/archive/html/qemu-block/2020-04/msg00745.html

Related to bug 1779893.

Comment 4 Eric Blake 2020-04-16 21:38:03 UTC

*** This bug has been marked as a duplicate of bug 1779904 ***