From patchwork Mon Jul 23 14:23:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [V4, 3/3] migration: block migration when any of the block device is busy From: Benoit Canet X-Patchwork-Id: 172697 Message-Id: <1343053380-12133-4-git-send-email-benoit@irqsave.net> To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@gmail.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , stefanha@linux.vnet.ibm.com, pbonzini@redhat.com Date: Mon, 23 Jul 2012 16:23:00 +0200 From: BenoĆ®t Canet Signed-off-by: Benoit Canet --- migration.c | 5 +++++ 1 file changed, 5 insertions(+) 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(¶ms); if (strstart(uri, "tcp:", &p)) {