From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoClC-0008Jx-6r for qemu-devel@nongnu.org; Mon, 19 Oct 2015 11:54:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoCl7-0006il-H2 for qemu-devel@nongnu.org; Mon, 19 Oct 2015 11:54:06 -0400 From: Max Reitz Date: Mon, 19 Oct 2015 17:53:08 +0200 Message-Id: <1445270025-22999-3-git-send-email-mreitz@redhat.com> In-Reply-To: <1445270025-22999-1-git-send-email-mreitz@redhat.com> References: <1445270025-22999-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v7 02/39] block: Set BDRV_O_INCOMING in bdrv_fill_options() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: Kevin Wolf , Alberto Garcia , Markus Armbruster , qemu-devel@nongnu.org, Max Reitz , John Snow , Stefan Hajnoczi 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 Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Reviewed-by: Alberto Garcia --- block.c | 4 ++++ blockdev.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 09f2a75..4fa2057 100644 --- 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; } diff --git a/blockdev.c b/blockdev.c index 8141b6b..27398b1 100644 --- a/blockdev.c +++ b/blockdev.c @@ -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, -- 2.6.1