From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTwjC-0002wj-NJ for qemu-devel@nongnu.org; Tue, 16 Sep 2014 13:39:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTwj4-0003LL-NJ for qemu-devel@nongnu.org; Tue, 16 Sep 2014 13:39:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTwj4-0003KW-GM for qemu-devel@nongnu.org; Tue, 16 Sep 2014 13:39:38 -0400 From: Markus Armbruster References: <1410620427-20089-1-git-send-email-armbru@redhat.com> <1410620427-20089-9-git-send-email-armbru@redhat.com> <20140916131831.GE27495@nodalink.com> <87a95zk69j.fsf@blackfin.pond.sub.org> <54184A05.1050005@redhat.com> Date: Tue, 16 Sep 2014 19:39:26 +0200 In-Reply-To: <54184A05.1050005@redhat.com> (Paolo Bonzini's message of "Tue, 16 Sep 2014 16:32:37 +0200") Message-ID: <87y4tj5usx.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 08/23] block: Eliminate BlockDriverState member device_name[] List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org, =?utf-8?Q?Beno=C3=AEt?= Canet Paolo Bonzini writes: > Il 16/09/2014 16:08, Markus Armbruster ha scritto: >>>> >> + if (bs->device_list.tqe_prev) { >>>> >> QTAILQ_REMOVE(&bdrv_states, bs, device_list); >>>> >> + bs->device_list.tqe_prev = NULL; >>> > >>> > I think a comments explaining the trick you are doing here would be worthy: >>> > after all you are touching directly the inner parts of a linked list and >>> > bypassing the list API. >> Fair enough. > > Or just add tqe_prev = NULL to QTAILQ_REMOVE. And add a QTAILQ_IN_ANY_QUEUE() macro, so I get rid of both .tqe_prev uses. I'll consider it, but either in v4 or as a follow-up patch, because I want to grep the source for similar trickery.