From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCGO6-0007L1-RH for qemu-devel@nongnu.org; Thu, 13 Sep 2012 16:51:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCGO5-0002ZJ-S9 for qemu-devel@nongnu.org; Thu, 13 Sep 2012 16:51:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCGO5-0002Z7-K0 for qemu-devel@nongnu.org; Thu, 13 Sep 2012 16:51:49 -0400 Message-ID: <50524742.6070702@redhat.com> Date: Thu, 13 Sep 2012 16:51:14 -0400 From: Jeff Cody MIME-Version: 1.0 References: <392c2852363a2cb420a1c53e7b13e85bc4ebf089.1347548248.git.jcody@redhat.com> <505243A9.7050004@redhat.com> In-Reply-To: <505243A9.7050004@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 03/16] block: Framework for reopening files safely Reply-To: jcody@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, stefanha@gmail.com, eblake@redhat.com, qemu-devel@nongnu.org, supriyak@linux.vnet.ibm.com On 09/13/2012 04:35 PM, Paolo Bonzini wrote: > Il 13/09/2012 17:49, Jeff Cody ha scritto: >> +typedef QSIMPLEQ_HEAD(BlockReopenQueue, BlockReopenQueueEntry) BlockReopenQueue; >> + >> +typedef struct BDRVReopenState { >> + BlockDriverState *bs; >> + int flags; >> + void *opaque; >> + BlockReopenQueue *queue; > > Do we need the queue pointer here? Or it can be a separate argument to > prepare? Commit and abort don't need it, and it may mess things up a > bit if commit calls bdrv_reopen_queue (because then the newly-added > element will get a commit without being prepared). > It could, and should, be a separate argument to prepare(), as you are correct - commit() and abort() should never use it. >> +} BDRVReopenState; >> + >> +typedef struct BlockReopenQueueEntry { >> + bool prepared; >> + BDRVReopenState state; >> + QSIMPLEQ_ENTRY(BlockReopenQueueEntry) entry; >> +} BlockReopenQueueEntry; >> + > > A small change: please move struct BlockReopenQueueEntry to block.c. > OK