From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2lyM-0000zM-AW for qemu-devel@nongnu.org; Wed, 29 Feb 2012 11:02:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2lyF-0005E7-7V for qemu-devel@nongnu.org; Wed, 29 Feb 2012 11:01:45 -0500 Received: from mail-pw0-f47.google.com ([209.85.160.47]:60616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2lyE-0005Dp-Uq for qemu-devel@nongnu.org; Wed, 29 Feb 2012 11:01:39 -0500 Received: by pbbrp12 with SMTP id rp12so6023802pbb.34 for ; Wed, 29 Feb 2012 08:01:36 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F4E4BDA.9000304@redhat.com> Date: Wed, 29 Feb 2012 17:01:30 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1330473276-8975-1-git-send-email-mjt@tls.msk.ru> <1330473276-8975-4-git-send-email-mjt@msgid.tls.msk.ru> In-Reply-To: <1330473276-8975-4-git-send-email-mjt@msgid.tls.msk.ru> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] Combine bdrv_co_readv and bdrv_co_writev into bdrv_co_rw_vector List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: kwolf@redhat.com, qemu-devel@nongnu.org Il 29/02/2012 00:54, Michael Tokarev ha scritto: > BlockDriver *drv = bs->drv; > BdrvTrackedRequest req; > + bool is_write = flags & (BDRV_REQ_WRITE|BDRV_REQ_ZERO_WRITE); > int ret; You can do BDRV_REQ_WRITE|BDRV_REQ_ZERO_WRITE, but not BDRV_REQ_READ|BDRV_REQ_COPY_ON_READ. That's ugly. > +/* defines for is_write for bdrv_*_rw_vector */ > +#define BDRV_READ false > +#define BDRV_WRITE true > + Please no, if you have to do this just change to bits. This would have the advantage of passing all the flags, including COPY_ON_READ. In some sense discard could be treated as a write too. I don't oppose this change completely, in fact I think adding the flags to co_readv/co_writev would be a good change. But I'm skeptical, the actual amount of unification is not that large. Paolo