From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDymE-0004EG-PU for qemu-devel@nongnu.org; Tue, 18 Sep 2012 10:27:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDym4-0003lU-74 for qemu-devel@nongnu.org; Tue, 18 Sep 2012 10:27:50 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:57485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDym4-0003lQ-0o for qemu-devel@nongnu.org; Tue, 18 Sep 2012 10:27:40 -0400 Received: by pbbrp12 with SMTP id rp12so102341pbb.4 for ; Tue, 18 Sep 2012 07:27:39 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <505884D5.9090109@redhat.com> Date: Tue, 18 Sep 2012 16:27:33 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1347968442-8860-1-git-send-email-kwolf@redhat.com> <1347968442-8860-11-git-send-email-kwolf@redhat.com> In-Reply-To: <1347968442-8860-11-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 10/16] qcow2: Delay the COW List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org Il 18/09/2012 13:40, Kevin Wolf ha scritto: > +again: > + QLIST_FOREACH(m, &s->cluster_allocs, next_in_flight) { > + if (m->sleeping) { > + qemu_coroutine_enter(m->co, NULL); > + /* next_in_flight link could have become invalid */ > + goto again; > + } > + } > + > qemu_co_rwlock_wrlock(&s->l2meta_flush); > } > > static inline coroutine_fn void resume_l2meta(BDRVQcowState *s) > { > + s->in_l2meta_flush = false; > qemu_co_rwlock_unlock(&s->l2meta_flush); > } > > static bool qcow2_drain(BlockDriverState *bs) > { > BDRVQcowState *s = bs->opaque; > + QCowL2Meta *m; > + > + QLIST_FOREACH(m, &s->cluster_allocs, next_in_flight) { > + if (m->sleeping) { > + qemu_coroutine_enter(m->co, NULL); > + } > + } > Why are the goto and in_l2meta_flush not needed here? If they are, perhaps stop_l2meta can just use qcow2_drain? Paolo