From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR02l-0003VA-Ez for qemu-devel@nongnu.org; Tue, 01 Oct 2013 09:31:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VR02c-0003H9-2Z for qemu-devel@nongnu.org; Tue, 01 Oct 2013 09:31:15 -0400 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:36213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR02b-0003Gz-QV for qemu-devel@nongnu.org; Tue, 01 Oct 2013 09:31:06 -0400 Received: by mail-we0-f179.google.com with SMTP id x55so7102733wes.24 for ; Tue, 01 Oct 2013 06:31:01 -0700 (PDT) Date: Tue, 1 Oct 2013 15:30:51 +0200 From: Stefan Hajnoczi Message-ID: <20131001133051.GE6035@stefanha-thinkpad.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v6 10/20] block: vhdx - add log write support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Wed, Sep 25, 2013 at 05:02:55PM -0400, Jeff Cody wrote: > +/* Perform a log write, and then immediately flush the entire log */ > +int vhdx_log_write_and_flush(BlockDriverState *bs, BDRVVHDXState *s, > + void *data, uint32_t length, uint64_t offset) > +{ > + int ret = 0; > + VHDXLogSequence logs = { .valid = true, > + .count = 1, > + .hdr = { 0 } }; > + > + > + ret = vhdx_log_write(bs, s, data, length, offset); > + if (ret < 0) { > + goto exit; > + } > + logs.log = s->log; I don't see a bdrv_co_flush() that ensures the log has been persisted before we begin applying log entries to the file. Without the flush there is no guarantee that the log entries will be accessible in case of power failure during vhdx_log_write_and_flush(). Stefan