From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3hxS-0000JF-9R for qemu-devel@nongnu.org; Fri, 20 May 2016 06:47:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3hxQ-0002Ao-Gj for qemu-devel@nongnu.org; Fri, 20 May 2016 06:47:05 -0400 Sender: Paolo Bonzini References: <1463671329-22655-1-git-send-email-kwolf@redhat.com> <1463671329-22655-22-git-send-email-kwolf@redhat.com> <6e34bd03-65d6-ceab-be3b-0e24450ed006@redhat.com> <20160520080549.GB4861@noname.redhat.com> <20160520081017.GC4861@noname.redhat.com> <03d90284-3538-d57f-dd93-920b6de227c8@redhat.com> <20160520102622.GF4861@noname.redhat.com> From: Paolo Bonzini Message-ID: Date: Fri, 20 May 2016 12:46:53 +0200 MIME-Version: 1.0 In-Reply-To: <20160520102622.GF4861@noname.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 21/31] block: Avoid bs->blk in bdrv_next() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org On 20/05/2016 12:26, Kevin Wolf wrote: > Hm, we have a few instances where an iterator variable is used for > multiple loops, so we need to be able to use it in an assignment, i.e. > it should be a compound literal. On the other hand, I seem to remember > that compound literals can't be used as initialisers. > > Maybe a bdrv_next_iterator_reset() function then? Which would be like > first/next, except that it doesn't return the first value yet. What qemu/queue.h does is is provide both FOO_INITIALIZER and FOO_INIT(&some_foo). Thanks, Paolo