Patchwork [3/3] do not allow migration if block copy in progress

login
register
mail settings
Submitter Marcelo Tosatti
Date Dec. 16, 2010, 5:44 p.m.
Message ID <20101216174810.740347376@redhat.com>
Download mbox | patch
Permalink /patch/75792/
State New
Headers show

Comments

Marcelo Tosatti - Dec. 16, 2010, 5:44 p.m.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Patch

Index: qemu-kvm-block-copy/migration.c
===================================================================
--- qemu-kvm-block-copy.orig/migration.c
+++ qemu-kvm-block-copy/migration.c
@@ -19,6 +19,7 @@ 
 #include "block.h"
 #include "qemu_socket.h"
 #include "block-migration.h"
+#include "block-copy.h"
 #include "qemu-objects.h"
 
 //#define DEBUG_MIGRATION
@@ -88,6 +89,11 @@  int do_migrate(Monitor *mon, const QDict
         return -1;
     }
 
+    if (block_copy_active()) {
+        monitor_printf(mon, "block copy in progress\n");
+        return -1;
+    }
+
     if (strstart(uri, "tcp:", &p)) {
         s = tcp_start_outgoing_migration(mon, p, max_throttle, detach,
                                          blk, inc);