Received: from eggs.gnu.org ([2001:4830:134:3::10]:49477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c72bi-0003uY-RG for qemu-devel@nongnu.org; Wed, 16 Nov 2016 10:58:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c72bi-0002Nz-3w for qemu-devel@nongnu.org; Wed, 16 Nov 2016 10:58:42 -0500 From: Alberto Garcia In-Reply-To: <1478798349-28983-4-git-send-email-kwolf@redhat.com> References: <1478798349-28983-1-git-send-email-kwolf@redhat.com> <1478798349-28983-4-git-send-email-kwolf@redhat.com> Date: Wed, 16 Nov 2016 16:57:44 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [RFC PATCH 3/8] quorum: Implement .bdrv_co_readv/writev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, qemu-devel@nongnu.org On Thu 10 Nov 2016 06:19:04 PM CET, Kevin Wolf wrote: > +typedef struct QuorumCo { > + QuorumAIOCB *acb; > int i; Maybe 'i' could rename to something a bit more descriptive ('idx', I don't know). > +} QuorumCo; > + > +static void read_quorum_children_entry(void *opaque) > +{ > + QuorumCo *co = opaque; > + QuorumAIOCB *acb = co->acb; > + BDRVQuorumState *s = acb->bs->opaque; > + int i = co->i; > + int ret; > + co = NULL; /* Not valid after the first yield */ I also don't understand this last line. Is it to make sure that no one tries to use it after the bdrv_co_preadv() call? > + acb->qcrs[i].bs = s->children[i]->bs; > + ret = bdrv_co_preadv(s->children[i], acb->sector_num * BDRV_SECTOR_SIZE, > + acb->nb_sectors * BDRV_SECTOR_SIZE, > + &acb->qcrs[i].qiov, 0); > + quorum_aio_cb(&acb->qcrs[i], ret); > +} Otherwise the patch looks good to me. Berto