Paolo Bonzini <pbonz...@redhat.com> 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.