From: Marc-André Lureau <[email protected]> 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 <[email protected]> Reviewed-by: Cédric Le Goater <[email protected]> --- accel/kvm/kvm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 0d8b0c43470..20131e563da 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3124,7 +3124,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 " -- 2.53.0
