]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
ram-block-attributes: Unify the retrieval of the block size
authorChenyi Qiang <chenyi.qiang@intel.com>
Thu, 23 Oct 2025 09:55:25 +0000 (17:55 +0800)
committerPeter Xu <peterx@redhat.com>
Mon, 3 Nov 2025 21:04:10 +0000 (16:04 -0500)
There's an existing helper function designed to obtain the block size.
Modify ram_block_attribute_create() to use this function for
consistency.

Tested-by: Farrah Chen <farrah.chen@intel.com>
Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
Link: https://lore.kernel.org/r/20251023095526.48365-3-chenyi.qiang@intel.com
[peterx: fix double spaces, per david]
Signed-off-by: Peter Xu <peterx@redhat.com>
system/ram-block-attributes.c

index a7579de5b468909a85d761c918a65ed33d363d52..fb7c5c274677520471f40fbb2ab98f2fdd0b6ae5 100644 (file)
@@ -390,7 +390,7 @@ int ram_block_attributes_state_change(RamBlockAttributes *attr,
 
 RamBlockAttributes *ram_block_attributes_create(RAMBlock *ram_block)
 {
-    const int block_size  = qemu_real_host_page_size();
+    const int block_size = ram_block_attributes_get_block_size();
     RamBlockAttributes *attr;
     MemoryRegion *mr = ram_block->mr;