From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SA1RQ-0005aw-4s for qemu-devel@nongnu.org; Tue, 20 Mar 2012 11:57:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SA1RM-0000dy-Hk for qemu-devel@nongnu.org; Tue, 20 Mar 2012 11:57:43 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:34368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SA1RM-0000dU-93 for qemu-devel@nongnu.org; Tue, 20 Mar 2012 11:57:40 -0400 Received: by werp12 with SMTP id p12so206664wer.4 for ; Tue, 20 Mar 2012 08:57:38 -0700 (PDT) Date: Tue, 20 Mar 2012 15:57:35 +0000 From: Stefan Hajnoczi Message-ID: <20120320155735.GC896@stefanha-thinkpad.localdomain> References: <1331055149-10982-1-git-send-email-benoit.canet@gmail.com> <1331055149-10982-3-git-send-email-benoit.canet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1331055149-10982-3-git-send-email-benoit.canet@gmail.com> Subject: Re: [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: =?iso-8859-1?Q?Beno=EEt?= Canet Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, wolf@redhat.com, stefanha@linux.vnet.ibm.com On Tue, Mar 06, 2012 at 06:32:21PM +0100, Benoît Canet wrote: > 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(-) The block layer doesn't need to keep track of incoming migrations: blockdev.c:drive_init() or vl.c:drive_init_func() could use runstate_check(RUN_STATE_INMIGRATE) to check whether incoming migration is in progress. If so, they would pass in BDRV_O_INCOMING during image creation. As a result we don't need to introduce this global variable or functions to manipulate it in the block layer. The block layer post migration function will still need to clear BDRV_O_INCOMING from open_flags. Stefan