From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4yFw-0000gR-1g for qemu-devel@nongnu.org; Tue, 06 Mar 2012 12:33:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4yFb-00054U-KJ for qemu-devel@nongnu.org; Tue, 06 Mar 2012 12:32:59 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:43745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4yFb-00053q-Ba for qemu-devel@nongnu.org; Tue, 06 Mar 2012 12:32:39 -0500 Received: by wgbfm10 with SMTP id fm10so3536306wgb.10 for ; Tue, 06 Mar 2012 09:32:37 -0800 (PST) From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Tue, 6 Mar 2012 18:32:21 +0100 Message-Id: <1331055149-10982-3-git-send-email-benoit.canet@gmail.com> In-Reply-To: <1331055149-10982-1-git-send-email-benoit.canet@gmail.com> References: <1331055149-10982-1-git-send-email-benoit.canet@gmail.com> Subject: [Qemu-devel] [RFC PATCH 02/10] block: add a function to set incoming live migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , stefanha@linux.vnet.ibm.com, wolf@redhat.com This function will help to inform the block layer that an incoming live migration is coming in order to make proper usage of the BDRV_O_INCOMING flag. Signed-off-by: Benoit Canet --- block.c | 8 ++++++++ block.h | 2 ++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 52ffe14..3e2260d 100644 --- a/block.c +++ b/block.c @@ -100,6 +100,8 @@ static BlockDriverState *bs_snapshots; /* If non-zero, use only whitelisted block drivers */ static int use_bdrv_whitelist; +static bool incoming_migration; + #ifdef _WIN32 static int is_windows_drive_prefix(const char *filename) { @@ -3580,6 +3582,12 @@ void bdrv_invalidate_cache_all(void) } } +void bdrv_set_incoming_migration(void) +{ + assert(incoming_migration == false); + incoming_migration = true; +} + int bdrv_flush(BlockDriverState *bs) { Coroutine *co; diff --git a/block.h b/block.h index e320d8f..23af1cc 100644 --- a/block.h +++ b/block.h @@ -223,6 +223,8 @@ BlockDriverAIOCB *bdrv_aio_ioctl(BlockDriverState *bs, void bdrv_invalidate_cache(BlockDriverState *bs); void bdrv_invalidate_cache_all(void); +void bdrv_set_incoming_migration(void); + /* Ensure contents are flushed to disk. */ int bdrv_flush(BlockDriverState *bs); int coroutine_fn bdrv_co_flush(BlockDriverState *bs); -- 1.7.7.6