Thanks Eric.
I have a few questions about the bitmap content shown by 'qemu-img map'.
>From below sample bitmap data:
1. Why only some of the extents have start and offset values? And why are
they the same values?
2. What does the start value indicate? Is it logical offset or physical
offset of data into qcow2?

root@be-proxmox1:/# qemu-img map --output=json --image-opts
"$IMG,x-dirty-bitmap=qemu:dirty-bitmap:bitmap1"
  [{ "start": 0, "length": 196608, "depth": 0, "present": true, "zero":
false, "data": true, "compressed": false, "offset": 0},
{ "start": 196608, "length": 65536, "depth": 0, "present": false, "zero":
false, "data": false, "compressed": false},
{ "start": 262144, "length": 105840640, "depth": 0, "present": true,
"zero": false, "data": true, "compressed": false, "offset": 262144},
{ "start": 106102784, "length": 95485952, "depth": 0, "present": false,
"zero": false, "data": false, "compressed": false},
{ "start": 201588736, "length": 145227776, "depth": 0, "present": true,
"zero": false, "data": true, "compressed": false, "offset": 201588736},
{ "start": 346816512, "length": 131072, "depth": 0, "present": false,
"zero": false, "data": false, "compressed": false},
{ "start": 346947584, "length": 131072, "depth": 0, "present": true,
"zero": false, "data": true, "compressed": false, "offset": 346947584},
{ "start": 347078656, "length": 65536, "depth": 0, "present": false,
"zero": false, "data": false, "compressed": false},
{ "start": 347144192, "length": 9699328, "depth": 0, "present": true,
"zero": false, "data": true, "compressed": false, "offset": 347144192},
{ "start": 356843520, "length": 131072, "depth": 0, "present": false,
"zero": false, "data": false, "compressed": false},
{ "start": 356974592, "length": 716767232, "depth": 0, "present": true,
"zero": false, "data": true, "compressed": false, "offset": 356974592}]


Regards
Prashant

On Thu, Mar 6, 2025 at 3:44 AM Eric Blake <ebl...@redhat.com> wrote:

> On Wed, Mar 05, 2025 at 03:36:35PM +0530, prashant patil wrote:
> > I was trying to read the bitmap of the running vm's disk. When I followed
> > below mentioned commands, then I was able to read the bitmap properly.
> > block-dirty-bitmap-add, block-dirty-bitmap-disable, nbd-server-start,
> > nbd-server-add,
>
> Up to here, everything you've done is indeed the ideal way to get at
> the contents of a bitmap from a live qemu process over an NBD connection.
>
> > qemu-img
> > map with x-dirty-bitmap image-opts.
>
> Here, this works, but feels like a hack, because it is relying on the
> x-dirty-bitmap feature of qemu.  The libnbd project ships with an
> application 'nbdinfo --map' that can read the same information as
> 'qemu-img map' but with a much nicer layout.  It's not going to
> necessarily be faster, but because it is a fully-supported feature of
> libnbd rather than a hack in qemu, it may prove more stable in the
> long run, and certainly easier to understand.
>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.
> Virtualization:  qemu.org | libguestfs.org
>
>

Reply via email to