]> git.proxmox.com Git - mirror_qemu.git/commit - hw/virtio/virtio-mem.c
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)
committerDavid Hildenbrand <david@redhat.com>
Wed, 28 Dec 2022 13:59:47 +0000 (14:59 +0100)
commitb11cf32e07a2f7ff0d171b89497381a04c9d07e0
tree9c717a8ecab78676c5255249dc0336b9d6e6ff9c
parent222059a0fccf4af3be776fe35a5ea2d6a68f9a0b
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>
hw/virtio/virtio-mem.c