summaryrefslogtreecommitdiffstats
path: root/stubs
diff options
context:
space:
mode:
authorYury Kotov2019-02-15 18:45:44 +0100
committerDr. David Alan Gilbert2019-03-06 11:49:17 +0100
commit754cb9c0ebcf2164107baf39e75517e459887622 (patch)
tree935baacab47105e5ac101848413b7bb3b39008d0 /stubs
parentmigration/rdma: clang compilation fix (diff)
downloadqemu-754cb9c0ebcf2164107baf39e75517e459887622.tar.gz
qemu-754cb9c0ebcf2164107baf39e75517e459887622.tar.xz
qemu-754cb9c0ebcf2164107baf39e75517e459887622.zip
exec: Change RAMBlockIterFunc definition
Currently, qemu_ram_foreach_* calls RAMBlockIterFunc with many block-specific arguments. But often iter func needs RAMBlock*. This refactoring is needed for fast access to RAMBlock flags from qemu_ram_foreach_block's callback. The only way to achieve this now is to call qemu_ram_block_from_host (which also enumerates blocks). So, this patch reduces complexity of qemu_ram_foreach_block() -> cb() -> qemu_ram_block_from_host() from O(n^2) to O(n). Fix RAMBlockIterFunc definition and add some functions to read RAMBlock* fields witch were passed. Signed-off-by: Yury Kotov <yury-kotov@yandex-team.ru> Message-Id: <20190215174548.2630-2-yury-kotov@yandex-team.ru> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'stubs')
-rw-r--r--stubs/ram-block.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/stubs/ram-block.c b/stubs/ram-block.c
index cfa5d8678f..73c0a3ee08 100644
--- a/stubs/ram-block.c
+++ b/stubs/ram-block.c
@@ -2,6 +2,21 @@
#include "exec/ramlist.h"
#include "exec/cpu-common.h"
+void *qemu_ram_get_host_addr(RAMBlock *rb)
+{
+ return 0;
+}
+
+ram_addr_t qemu_ram_get_offset(RAMBlock *rb)
+{
+ return 0;
+}
+
+ram_addr_t qemu_ram_get_used_length(RAMBlock *rb)
+{
+ return 0;
+}
+
void ram_block_notifier_add(RAMBlockNotifier *n)
{
}