From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M1L3n-0003fJ-OT for qemu-devel@nongnu.org; Tue, 05 May 2009 09:51:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M1L3j-0003dE-8M for qemu-devel@nongnu.org; Tue, 05 May 2009 09:51:51 -0400 Received: from [199.232.76.173] (port=50821 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1L3j-0003d7-0d for qemu-devel@nongnu.org; Tue, 05 May 2009 09:51:47 -0400 Received: from mx2.redhat.com ([66.187.237.31]:58999) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M1L3i-0008Uq-9r for qemu-devel@nongnu.org; Tue, 05 May 2009 09:51:46 -0400 Message-ID: <4A00446B.7070404@redhat.com> Date: Tue, 05 May 2009 16:51:39 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] barriers: block layer preparations References: <20090505120804.GA30651@lst.de> <20090505120817.GA30721@lst.de> In-Reply-To: <20090505120817.GA30721@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org Christoph Hellwig wrote: > Add a flag to BlockDriverState to advertise barriers support, and add a flags > argument to bdrv_aio_readv/writev to allow passing down the barrier flag. > > Note that the flags argument to bdrv_aio_readv is for now actually superflous > because write barriers obviously only apply to writes. I kept the read side > argument so the API is symmetric and we can easily add more flags to both > of them. > > > @@ -1498,7 +1498,7 @@ static void qcow_aio_write_cb(void *opaq > acb->hd_aiocb = bdrv_aio_writev(s->hd, > (acb->cluster_offset >> 9) + index_in_cluster, > &acb->hd_qiov, acb->n, > - qcow_aio_write_cb, acb); > + qcow_aio_write_cb, acb, 2); > 2? An alternative approach is to add a new op, bdrv_aio_barrier(), submitted immediately after the write. It's probably more complicated overall. A barrier for read can be meaningful if the guest wishes to read a known-to-be-stable write. I don't think any guest can make use of this though. -- error compiling committee.c: too many arguments to function