qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 1/4] migration/debug: Introduce foreach_migratable_block()


From: Chuan Zheng
Subject: [PATCH v1 1/4] migration/debug: Introduce foreach_migratable_block()
Date: Mon, 26 Oct 2020 21:58:42 +0800

Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
---
 migration/ram.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/migration/ram.c b/migration/ram.c
index 433489d..aa39908 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -166,6 +166,22 @@ bool ramblock_is_ignored(RAMBlock *block)
 
 #undef RAMBLOCK_FOREACH
 
+static int foreach_migratable_block(RAMBlockIterFunc func, void *opaque)
+{
+    RAMBlock *block;
+    int ret = 0;
+
+    rcu_read_lock();
+    RAMBLOCK_FOREACH_MIGRATABLE(block) {
+        ret = func(block, opaque);
+        if (ret) {
+            break;
+        }
+    }
+    rcu_read_unlock();
+    return ret;
+}
+
 int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque)
 {
     RAMBlock *block;
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]