From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2mD7-000158-3H for qemu-devel@nongnu.org; Wed, 29 Feb 2012 11:17:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2mCx-0008E3-6h for qemu-devel@nongnu.org; Wed, 29 Feb 2012 11:17:00 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:56234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2mCw-0008Dc-Vm for qemu-devel@nongnu.org; Wed, 29 Feb 2012 11:16:51 -0500 Message-ID: <4F4E4F70.3060500@msgid.tls.msk.ru> Date: Wed, 29 Feb 2012 20:16:48 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <1330473276-8975-1-git-send-email-mjt@tls.msk.ru> <1330473276-8975-3-git-send-email-mjt@msgid.tls.msk.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] Combine bdrv_aio_readv and bdrv_aio_writev into bdrv_aio_rw_vector List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 29.02.2012 19:54, Paolo Bonzini wrote: > Il 29/02/2012 00:54, Michael Tokarev ha scritto: >> iscsi block driver may receive some additional work. For now, some >> common code has been moved out of iscsi_aio_writev() and iscsi_aio_readv() >> into iscsi_aio_rw_vector(). Leftovers there can be optimized further, >> and consolidated into the rw_vector too. Read and write callbacks are >> consolidated as well, and once the XXX "todo" bounce-buffer change is >> complete the only difference there should go away too. > > What about flush, discard, etc.? > > It seems to me that either we make a single entry point that takes some > kind of BlockRequest, or there is no reason to do partial unification. Flush and discard are quite special. _All_ drivers provide reads and writes (well, except of the case when the device is read-only by definition). But very few provides discard, and discard is different from reads and writes because it does not take any data. Flush is of the same nature -- it is just request, no data. So for these, separate methods exists and are in use now -- only in these drivers where it is appropriate. The only additional flag or operation which can be passed - which I can think of, anyway - is WRITE_ZEROES. But I think it is more of discard variety than read/write. So there, maybe it is discard method which may be combined with write_zeroes, but not discard and flush combined with reads and writes. Thanks, /mjt