block: Set BDRV_O_INCOMING in bdrv_fill_options()
authorMax Reitz <mreitz@redhat.com>
Mon, 19 Oct 2015 15:53:08 +0000 (17:53 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 23 Oct 2015 16:18:22 +0000 (18:18 +0200)
This flag should not be set for the root BDS only, but for any BDS that
is being created while incoming migration is pending, so setting it is
moved from blockdev_init() to bdrv_fill_options().

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
blockdev.c

diff --git a/block.c b/block.c
index 6771c3a1a19fa1fe233665f8209fb2f0fbc4851c..d1bf121ffabca89627fb0050da1070e434e2c306 100644 (file)
--- a/block.c
+++ b/block.c
@@ -1081,6 +1081,10 @@ static int bdrv_fill_options(QDict **options, const char **pfilename,
         }
     }
 
+    if (runstate_check(RUN_STATE_INMIGRATE)) {
+        *flags |= BDRV_O_INCOMING;
+    }
+
     return 0;
 }
 
index 8141b6b3da5dd287b2efcaccc71d184fadd748da..27398b1041b7dac808e6a3757bfb4585a129fbed 100644 (file)
@@ -537,10 +537,6 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
             bdrv_flags |= BDRV_O_COPY_ON_READ;
         }
 
-        if (runstate_check(RUN_STATE_INMIGRATE)) {
-            bdrv_flags |= BDRV_O_INCOMING;
-        }
-
         bdrv_flags |= ro ? 0 : BDRV_O_RDWR;
 
         blk = blk_new_open(qemu_opts_id(opts), file, NULL, bs_opts, bdrv_flags,