[V2,3/3] migration: block migration when streaming block jobs are running.

Submitted by Benoit Canet on July 23, 2012, 11:23 a.m.

Details

Message ID 1343042615-5013-4-git-send-email-benoit@irqsave.net
State New
Headers show

Commit Message

Benoit Canet July 23, 2012, 11:23 a.m.
From: BenoƮt Canet <benoit@irqsave.net>

Signed-off-by: Benoit Canet <benoit@irqsave.net>
---
 migration.c |    5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/migration.c b/migration.c
index 8db1b43..5196d7e 100644
--- a/migration.c
+++ b/migration.c
@@ -425,6 +425,11 @@  void qmp_migrate(const char *uri, bool has_blk, bool blk,
         return;
     }
 
+    if (bdrv_are_busy()) {
+        error_set(errp, QERR_STREAMING_BLOCKS_MIGRATION);
+        return;
+    }
+
     s = migrate_init(&params);
 
     if (strstart(uri, "tcp:", &p)) {