]> Git Repo - qemu.git/blobdiff - migration/ram.c
migration: hold the lock only if it is really needed
[qemu.git] / migration / ram.c
index 40013e68a1d051ed28cef515783a8a2cf86a9853..79c89425a34e2eb3daaaf964129fcb81a606dab5 100644 (file)
@@ -2033,6 +2033,10 @@ static RAMBlock *unqueue_page(RAMState *rs, ram_addr_t *offset)
 {
     RAMBlock *block = NULL;
 
+    if (QSIMPLEQ_EMPTY_ATOMIC(&rs->src_page_requests)) {
+        return NULL;
+    }
+
     qemu_mutex_lock(&rs->src_page_req_mutex);
     if (!QSIMPLEQ_EMPTY(&rs->src_page_requests)) {
         struct RAMSrcPageRequest *entry =
This page took 0.022939 seconds and 4 git commands to generate.