From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDz7i-00073f-9r for qemu-devel@nongnu.org; Tue, 18 Sep 2012 10:50:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDz7c-0003Ny-K0 for qemu-devel@nongnu.org; Tue, 18 Sep 2012 10:50:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDz7c-0003M5-3t for qemu-devel@nongnu.org; Tue, 18 Sep 2012 10:49:56 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8IEnsJs006221 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 18 Sep 2012 10:49:54 -0400 Message-ID: <50588A10.6090008@redhat.com> Date: Tue, 18 Sep 2012 16:49:52 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1347968442-8860-1-git-send-email-kwolf@redhat.com> <1347968442-8860-11-git-send-email-kwolf@redhat.com> <505884D5.9090109@redhat.com> In-Reply-To: <505884D5.9090109@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: Paolo Bonzini Cc: qemu-devel@nongnu.org Am 18.09.2012 16:27, schrieb Paolo Bonzini: > 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? I think you're right, thanks. Kevin