[PATCH v6 12/18] colo: Hold the BQL while sending ram state

Lukas Straub posted 18 patches 8 hours ago
Maintainers: Pierrick Bouvier <pierrick.bouvier@linaro.org>, Lukas Straub <lukasstraub2@web.de>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH v6 12/18] colo: Hold the BQL while sending ram state
Posted by Lukas Straub 8 hours ago
qemu_savevm_state_complete_precopy() requires that BQL is held.

This fixes a crash when running with TCG accel.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
---
 migration/colo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/migration/colo.c b/migration/colo.c
index afab8eeb14d09c1db9b235121c5845b11a80deba..74338a59b563846f4562161942001889dd6191bc 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -457,9 +457,8 @@ static int colo_do_checkpoint_transaction(MigrationState *s,
 
     /* Note: device state is saved into buffer */
     ret = qemu_save_device_state(fb);
-
-    bql_unlock();
     if (ret < 0) {
+        bql_unlock();
         goto out;
     }
 
@@ -472,6 +471,7 @@ static int colo_do_checkpoint_transaction(MigrationState *s,
      * to be blocked here.
      */
     qemu_savevm_live_state(s->to_dst_file);
+    bql_unlock();
 
     qemu_fflush(fb);
 

-- 
2.39.5