@samitouri / QOSamiQemu / commits / 554671c1ec

kvm: replace RamDicardManager by the RamBlockAttribute

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>

Marc-André Lureau committed Feb 26, 2026 at 14:59 UTC 554671c1ec6eaf3770808df091632d77cd62b5d5
1 file changed +1 -1
accel/kvm/kvm-all.c
+1 -1
@@ -3404,7 +3404,7 @@ int kvm_convert_memory(hwaddr start, hwaddr size, bool to_private)
3404 addr = memory_region_get_ram_ptr(mr) + section.offset_within_region;
3405 rb = qemu_ram_block_from_host(addr, false, &offset);
3406
3407 - ret = ram_block_attributes_state_change(RAM_BLOCK_ATTRIBUTES(mr->rdm),
3407 + ret = ram_block_attributes_state_change(rb->attributes,
3408 offset, size, to_private);
3409 if (ret) {
3410 error_report("Failed to notify the listener the state change of "