From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuIW0-0003nx-N4 for qemu-devel@nongnu.org; Wed, 03 Jul 2013 04:34:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuIVx-0003NW-Vw for qemu-devel@nongnu.org; Wed, 03 Jul 2013 04:34:16 -0400 Date: Wed, 3 Jul 2013 10:34:11 +0200 From: Stefan Hajnoczi Message-ID: <20130703083411.GA17434@stefanha-thinkpad.muc.redhat.com> References: <1372772185-10958-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1372772185-10958-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] block: fix bdrv_flush() ordering in bdrv_close() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-stable@nongnu.org On Tue, Jul 02, 2013 at 03:36:25PM +0200, Stefan Hajnoczi wrote: > Since 80ccf93b we flush the block device during close. The > bdrv_drain_all() call should come before bdrv_flush() to ensure guest > write requests have completed. Otherwise we may miss pending writes > when flushing. > > Call bdrv_drain_all() again for safety as the final step after > bdrv_flush(). This should not be necessary but we can be paranoid here > in case bdrv_flush() left I/O pending. > > Cc: qemu-stable@nongnu.org > Signed-off-by: Stefan Hajnoczi > --- > v2: > * Drain after block_job_cancel_sync() [kwolf] > > block.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) Applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan