From patchwork Tue Mar 6 17:32:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Canet X-Patchwork-Id: 144963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9FD7FB6F62 for ; Wed, 7 Mar 2012 04:33:16 +1100 (EST) Received: from localhost ([::1]:53122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4yGA-0000xa-Ga for incoming@patchwork.ozlabs.org; Tue, 06 Mar 2012 12:33:14 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=FflagdYIgWhtAjB0kZbVdSvxeY/LHAsQGsyXolf5Jaw=; b=O0EuCvF7KUWLBiUbiHKM1mNIinDfRiXumRl2aXu+JK91bJmI5CQz11EKTw0yAnhLAI 2CGlm3/E7NFB5HfV5n8qePy2s9j00BjP2ag64J1hlbKtvWv/3DDxpFgeatfcDzHVTOac 4BO9Bv/jqiUJA3M5dYS1Th3AxDcJeStGYrL5+/+4ur5ls90NNBP/gN2bTUKRn3LCyjc9 RTYCv095iA9FxwjgSAXvavukvkpuKLMV9bzfZXSKX7oKPubfj/0xWy99YAjCvv4WmIfD De86B6iXrFeEq6I/na9pN9EnvYUo4WvWkUuYIxHqAezb9fCnu1VA1KUReZixbdHVE7GX OJZw== Received: by 10.180.86.230 with SMTP id s6mr20475645wiz.16.1331055157453; Tue, 06 Mar 2012 09:32:37 -0800 (PST) Received: from Laure.box.in.chocolate-blue.net ([109.190.18.76]) by mx.google.com with ESMTPS id hn8sm81593717wib.11.2012.03.06.09.32.36 (version=SSLv3 cipher=OTHER); Tue, 06 Mar 2012 09:32:36 -0800 (PST) From: =?UTF-8?q?Beno=C3=AEt=20Canet?= To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2012 18:32:21 +0100 Message-Id: <1331055149-10982-3-git-send-email-benoit.canet@gmail.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1331055149-10982-1-git-send-email-benoit.canet@gmail.com> References: <1331055149-10982-1-git-send-email-benoit.canet@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.53 Cc: pbonzini@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , stefanha@linux.vnet.ibm.com, wolf@redhat.com Subject: [Qemu-devel] [RFC PATCH 02/10] block: add a function to set incoming live migration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);