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, qemu-img map with x-dirty-bitmap image-opts.
Please let me know if there is any other better alternative to do the same. Thanks Prashant On Fri, Feb 28, 2025 at 3:53 AM Eric Blake <ebl...@redhat.com> wrote: > On Wed, Feb 19, 2025 at 04:23:26PM +0530, prashant patil wrote: > > Hello All, > > Hope this email finds you well. > > > > I have been trying with qemu for a while now, and have come across a > > problem specific to dirty bitmaps. I have enabled bitmap on the qcow2 > disk > > image using 'qemu-img bitmap' command, exposed the bitmap over a unix > > socket using 'qemu-nbd' command. Now when I try to read the bitmap using > > 'qemu-img map' command with 'x-dirty-bitmap=qemu:dirty-bitmap:{bitmap}' > > option, I get one single extent which shows that the entire disk is > dirty. > > Note that the disk size is 5 GB, and has only a few MB of data in it, and > > had added very small data after the bitmap was enabled. Bitmap output has > > been pasted below. > > Can you show the exact sequence of command lines you used to create > the image, dirty a portion of it, then start up the qemu-nbd process > to inspect it? As written, I can't reproduce your issue, but I know > it sounds similar to tests/qemu-iotests/tests/qemu-img-bitmaps which > does what you're talking about, so I know the code works and have to > suspect you may have missed a step or reordered things in such a way > that the entire bitmap is reading as dirty. > > > > > [{ "start": 0, "length": 5368709120, "depth": 0, "present": true, "zero": > > false, "data": true, "compressed": false, "offset": 0}] > > > > Can someone please help me understand why the bitmap content shows the > > entire disk as dirty? > > -- > Eric Blake, Principal Software Engineer > Red Hat, Inc. > Virtualization: qemu.org | libguestfs.org > >