From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCCjL-0001pa-JV for qemu-devel@nongnu.org; Thu, 13 Sep 2012 12:57:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCCjK-00082C-CC for qemu-devel@nongnu.org; Thu, 13 Sep 2012 12:57:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCCjK-000823-3G for qemu-devel@nongnu.org; Thu, 13 Sep 2012 12:57:30 -0400 Message-ID: <50521070.5020302@redhat.com> Date: Thu, 13 Sep 2012 12:57:20 -0400 From: Jeff Cody MIME-Version: 1.0 References: <6316cedacd954f8106aca8a45618088e24c4a757.1347548248.git.jcody@redhat.com> <50520394.9030100@redhat.com> In-Reply-To: <50520394.9030100@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 08/16] block: raw-posix image file reopen Reply-To: jcody@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, supriyak@linux.vnet.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, stefanha@gmail.com On 09/13/2012 12:02 PM, Paolo Bonzini wrote: > Il 13/09/2012 17:49, Jeff Cody ha scritto: >> + >> + /* >> + * If we didn't have BDRV_O_NOCACHE set before, we may not have allocated >> + * aligned_buf >> + */ >> + ret = raw_allocate_aligned_buf(&raw_s->aligned_buf, >> + &raw_s->aligned_buf_size, state->flags); > > Aligned_buf is unused, except for checking if it exists here: > > if (s->aligned_buf) { > if (!qiov_is_aligned(bs, qiov)) { > type |= QEMU_AIO_MISALIGNED; > #ifdef CONFIG_LINUX_AIO > } else if (s->use_aio) { > return laio_submit(bs, s->aio_ctx, s->fd, sector_num, qiov, > nb_sectors, cb, opaque, type); > #endif > } > } > > You can instead check BDRV_O_NOCACHE and kill aligned_buf completely. > > Paolo > Hmm - yes, it looks like that is so. This patch will transform into checking for BDRV_O_NOCACHE as you suggest, and killing aligned_buf. Thanks, Jeff