]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
kvm: replace RamDicardManager by the RamBlockAttribute
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 26 Feb 2026 13:59:50 +0000 (14:59 +0100)
committerPeter Xu <peterx@redhat.com>
Mon, 9 Mar 2026 18:06:30 +0000 (14:06 -0400)
No need to cast through the RamDiscardManager interface, use the
RamBlock already retrieved. Makes it more direct and readable, and allow
further refactoring to make RamDiscardManager an aggregator object in
the following patches.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Chenyi Qiang <chenyi.qiang@intel.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/20260226140001.3622334-6-marcandre.lureau@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
accel/kvm/kvm-all.c

index ebd721c3d66d867555e849e18d847693357629cb..984db9777959a27abf5f5e2c35e5d23cb78bb71f 100644 (file)
@@ -3404,7 +3404,7 @@ int kvm_convert_memory(hwaddr start, hwaddr size, bool to_private)
     addr = memory_region_get_ram_ptr(mr) + section.offset_within_region;
     rb = qemu_ram_block_from_host(addr, false, &offset);
 
-    ret = ram_block_attributes_state_change(RAM_BLOCK_ATTRIBUTES(mr->rdm),
+    ret = ram_block_attributes_state_change(rb->attributes,
                                             offset, size, to_private);
     if (ret) {
         error_report("Failed to notify the listener the state change of "