system/ramblock: Move ram_block_discard_*_range() declarations

Keep RAM blocks API in the same header: "system/ramblock.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Peter Xu <peterx@redhat.com>
Message-Id: <20251002032812.26069-4-philmd@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2025-09-29 16:25:59 +02:00
parent 34f9b0ad08
commit 8fe6ce4019
6 changed files with 8 additions and 3 deletions

View file

@ -32,6 +32,7 @@
#include "system/runstate.h" #include "system/runstate.h"
#include "system/cpus.h" #include "system/cpus.h"
#include "system/accel-blocker.h" #include "system/accel-blocker.h"
#include "system/ramblock.h"
#include "accel/accel-ops.h" #include "accel/accel-ops.h"
#include "qemu/bswap.h" #include "qemu/bswap.h"
#include "exec/tswap.h" #include "exec/tswap.h"

View file

@ -8,6 +8,7 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "system/ramblock.h"
#include "hv-balloon-internal.h" #include "hv-balloon-internal.h"
#include "hv-balloon-our_range_memslots.h" #include "hv-balloon-our_range_memslots.h"
#include "trace.h" #include "trace.h"

View file

@ -23,6 +23,7 @@
#include "hw/qdev-properties.h" #include "hw/qdev-properties.h"
#include "hw/boards.h" #include "hw/boards.h"
#include "system/balloon.h" #include "system/balloon.h"
#include "system/ramblock.h"
#include "hw/virtio/virtio-balloon.h" #include "hw/virtio/virtio-balloon.h"
#include "system/address-spaces.h" #include "system/address-spaces.h"
#include "qapi/error.h" #include "qapi/error.h"

View file

@ -17,6 +17,7 @@
#include "qemu/units.h" #include "qemu/units.h"
#include "system/numa.h" #include "system/numa.h"
#include "system/system.h" #include "system/system.h"
#include "system/ramblock.h"
#include "system/reset.h" #include "system/reset.h"
#include "system/runstate.h" #include "system/runstate.h"
#include "hw/virtio/virtio.h" #include "hw/virtio/virtio.h"

View file

@ -163,9 +163,6 @@ void cpu_flush_icache_range(hwaddr start, hwaddr len);
typedef int (RAMBlockIterFunc)(RAMBlock *rb, void *opaque); typedef int (RAMBlockIterFunc)(RAMBlock *rb, void *opaque);
int qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque); int qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque);
int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length);
int ram_block_discard_guest_memfd_range(RAMBlock *rb, uint64_t start,
size_t length);
/* Returns: 0 on success, -1 on error */ /* Returns: 0 on success, -1 on error */
int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,

View file

@ -103,6 +103,10 @@ struct RamBlockAttributes {
QLIST_HEAD(, RamDiscardListener) rdl_list; QLIST_HEAD(, RamDiscardListener) rdl_list;
}; };
int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length);
int ram_block_discard_guest_memfd_range(RAMBlock *rb, uint64_t start,
size_t length);
RamBlockAttributes *ram_block_attributes_create(RAMBlock *ram_block); RamBlockAttributes *ram_block_attributes_create(RAMBlock *ram_block);
void ram_block_attributes_destroy(RamBlockAttributes *attr); void ram_block_attributes_destroy(RamBlockAttributes *attr);
int ram_block_attributes_state_change(RamBlockAttributes *attr, uint64_t offset, int ram_block_attributes_state_change(RamBlockAttributes *attr, uint64_t offset,