From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq0Pk-0001kG-O1 for qemu-devel@nongnu.org; Mon, 09 Dec 2013 07:58:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vq0Pe-0006gq-PJ for qemu-devel@nongnu.org; Mon, 09 Dec 2013 07:58:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq0Pe-0006gm-IG for qemu-devel@nongnu.org; Mon, 09 Dec 2013 07:58:14 -0500 Date: Mon, 9 Dec 2013 13:58:06 +0100 From: Kevin Wolf Message-ID: <20131209125806.GC3549@dhcp-200-207.str.redhat.com> References: <1386350580-5666-1-git-send-email-kwolf@redhat.com> <1386350580-5666-6-git-send-email-kwolf@redhat.com> <52A20F0E.8070001@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52A20F0E.8070001@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH 05/19] raw: Probe required direct I/O alignment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com, armbru@redhat.com Am 06.12.2013 um 18:53 hat Paolo Bonzini geschrieben: > Il 06/12/2013 18:22, Kevin Wolf ha scritto: > > @@ -1227,6 +1288,7 @@ static BlockDriver bdrv_file = { > > .bdrv_aio_writev = raw_aio_writev, > > .bdrv_aio_flush = raw_aio_flush, > > .bdrv_aio_discard = raw_aio_discard, > > + .bdrv_opt_mem_align = raw_opt_mem_align, > > > > .bdrv_truncate = raw_truncate, > > .bdrv_getlength = raw_getlength, > > @@ -1582,6 +1644,7 @@ static BlockDriver bdrv_host_device = { > > .bdrv_aio_writev = raw_aio_writev, > > .bdrv_aio_flush = raw_aio_flush, > > .bdrv_aio_discard = hdev_aio_discard, > > + .bdrv_opt_mem_align = raw_opt_mem_align, > > Should this rather be a BlockLimits field? How is BlockLimits supposed with respect to inheritance of values through the BDS tree? I tried looking at the code, but for example bl.opt_transfer_length is only forwarded in raw, so for any other format (or if you ever put a filter there) it simply doesn't work. I could initialise a new BlockLimits.opt_mem_align field in bdrv_open_common() with the value of bs->file->bl.opt_mem_align, and in bdrv_open_backing_file() change it to MAX(bs->bl.opt_mem_align, bs->backing_hd->bl.opt_mem_align). The block driver could then in bdrv_open() override the former, but never the latter. What would happen on bdrv_reopen(), specifically toggling O_DIRECT? The values would have to change then. Kevin