Patchwork [01/14] Unlock ramlist lock also in error case

login
register
mail settings
Submitter Juan Quintela
Date Jan. 15, 2013, 11:18 a.m.
Message ID <1358248702-14278-2-git-send-email-quintela@redhat.com>
Download mbox | patch
Permalink /patch/212107/
State New
Headers show

Comments

Juan Quintela - Jan. 15, 2013, 11:18 a.m.
From: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 arch_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/arch_init.c b/arch_init.c
index 86f8544..8c833b6 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -642,12 +642,13 @@  static int ram_save_iterate(QEMUFile *f, void *opaque)
         i++;
     }

+    qemu_mutex_unlock_ramlist();
+
     if (ret < 0) {
         bytes_transferred += total_sent;
         return ret;
     }

-    qemu_mutex_unlock_ramlist();
     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
     total_sent += 8;
     bytes_transferred += total_sent;