Bug 1780359 - RFE: Add bitmap size measurement for existing images
Summary: RFE: Add bitmap size measurement for existing images
Keywords:
Status: CLOSED DUPLICATE of bug 1779904
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.4
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: 8.0
Assignee: John Snow
QA Contact: aihua liang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-05 18:41 UTC by John Snow
Modified: 2020-04-17 02:34 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-16 21:38:03 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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 ***


Note You need to log in before you can comment on or make changes to this bug.