Patchwork [V4,3/3] migration: block migration when any of the block device is busy

login
register
mail settings
Submitter Benoit Canet
Date July 23, 2012, 2:23 p.m.
Message ID <1343053380-12133-4-git-send-email-benoit@irqsave.net>
Download mbox | patch
Permalink /patch/172697/
State New
Headers show

Comments

Benoit Canet - July 23, 2012, 2:23 p.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

diff --git a/migration.c b/migration.c
index 8db1b43..3d68996 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_BLOCK_DEV_IN_USE_MIGRATION_PREVENTED);
+        return;
+    }
+
     s = migrate_init(&params);
 
     if (strstart(uri, "tcp:", &p)) {