]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-mem: Fix the bitmap index of the section offset
authorChenyi Qiang <chenyi.qiang@intel.com>
Fri, 16 Dec 2022 06:22:31 +0000 (14:22 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 29 Mar 2023 07:20:04 +0000 (10:20 +0300)
commit5f43c7786eaec3689aff3f2ea6101c54828a7f3e
treee5f71830655421545e559e9b2321e322368ee762
parentf16011abc161e0fa6ac2bea78aa7ebacfb173e59
virtio-mem: Fix the bitmap index of the section offset

vmem->bitmap indexes the memory region of the virtio-mem backend at a
granularity of block_size. To calculate the index of target section offset,
the block_size should be divided instead of the bitmap_size.

Fixes: 2044969f0b ("virtio-mem: Implement RamDiscardManager interface")
Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
Message-Id: <20221216062231.11181-1-chenyi.qiang@intel.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: David Hildenbrand <david@redhat.com>
(cherry picked from commit b11cf32e07a2f7ff0d171b89497381a04c9d07e0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/virtio/virtio-mem.c