On Sat, Jun 12, 2021 at 02:39:44AM +0300, Nir Soffer wrote:
> Since this change is not simple, and the chance that we also get the dirty
> bitmap included in the result seems to be very low, I decided to check the
> direction of merging multiple extents.
>
> I started with merging "base:allocation" and
"qemu:dirty-bitmap:xxx" since
> we already have both. It was not hard to do, although it is not completely
> tested yet.
>
> Here is the merging code:
>
https://gerrit.ovirt.org/c/ovirt-imageio/+/115216/1/daemon/ovirt_imageio/...
>
> To make merging easy and safe, we map the NBD_STATE_DIRTY bit to a private bit
> so it cannot clash with the NBD_STATE_HOLE bit:
>
https://gerrit.ovirt.org/c/ovirt-imageio/+/115215/1/daemon/ovirt_imageio/...
>
> Here is a functional test using qemu-nbd showing that it works:
>
https://gerrit.ovirt.org/c/ovirt-imageio/+/115216/1/daemon/test/client_te...
>
> I'll try to use "qemu:allocation-depth" in a similar way next week,
probably
> mapping depth > 0 to EXTENT_EXISTS, to use when reporting holes in
> single qcow2 images.
>
> If this is successful, we can start using this in the next ovirt release, and we
> don't need "qemu:joint-allocation".
That's nice to know. So at this point, we'll drop the patch on
qemu:joint-allocation, and instead focus on teh patch that improves
qemu-img map output to make it easier to use in the same way that
qemu:allocation-depth is.