Received: from eggs.gnu.org ([2001:4830:134:3::10]:58856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK1SZ-00038m-1b for qemu-devel@nongnu.org; Wed, 29 Nov 2017 07:27:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eK1SU-0000Cm-27 for qemu-devel@nongnu.org; Wed, 29 Nov 2017 07:27:27 -0500 From: Alberto Garcia In-Reply-To: <20171129102513.9153-2-pbonzini@redhat.com> References: <20171129102513.9153-1-pbonzini@redhat.com> <20171129102513.9153-2-pbonzini@redhat.com> Date: Wed, 29 Nov 2017 13:27:19 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 1/4] block: Expect graph changes in bdrv_parent_drained_begin/end List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, qemu-block@nongnu.org On Wed 29 Nov 2017 11:25:10 AM CET, Paolo Bonzini wrote: > From: Kevin Wolf > > The .drained_begin/end callbacks can (directly or indirectly via > aio_poll()) cause block nodes to be removed or the current BdrvChild to > point to a different child node. > > Use QLIST_FOREACH_SAFE() to make sure we don't access invalid > BlockDriverStates or accidentally continue iterating the parents of the > new child node instead of the node we actually came from. > > Signed-off-by: Kevin Wolf > Tested-by: Jeff Cody > Reviewed-by: Stefan Hajnoczi > Reviewed-by: Jeff Cody Reviewed-by: Alberto Garcia Berto