From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36898 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PDH1r-0004hT-Uc for qemu-devel@nongnu.org; Tue, 02 Nov 2010 09:36:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PDEL2-0007YJ-Lp for qemu-devel@nongnu.org; Tue, 02 Nov 2010 06:43:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PDEL2-0007Wt-Eo for qemu-devel@nongnu.org; Tue, 02 Nov 2010 06:43:36 -0400 Message-ID: <4CCFEB54.5030103@redhat.com> Date: Tue, 02 Nov 2010 11:43:32 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 06/40] qdev-ify: xen backends References: <1288623713-28062-1-git-send-email-agraf@suse.de> <1288623713-28062-7-git-send-email-agraf@suse.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Alexander Graf , qemu-devel Developers On 11/02/10 11:08, Markus Armbruster wrote: > Alexander Graf writes: > >> From: Gerd Hoffmann >> >> This patch converts the xen backend code to qdev. > > qdev conversions are always welcome. This one's not complete (search > for #if 0). It is a tricky one too. Creating the xen backend device instances is controlled via xenstore (either emulated in case of xenner or xenstored when running on Xen). When creating block/net backends via qemu command line switches all qemu does is creating the xenstore entries. Having a external entity (i.e. xend) creating the xenstore entries works too. This workflow is a bit hard to fit into the qdev model ... >> + do { >> + done = 1; >> + QLIST_FOREACH(qdev,&xenbus->qbus.children, sibling) { >> + xendev = container_of(qdev, struct XenDevice, qdev); [ ... ] >> + done = 0; >> + break; >> + } >> + } while (!done); > > This loop nest confuses me. Why can't we just QLIST_FOREACH_SAFE()? Just historical reasons I guess. QLIST_FOREACH_SAFE() wasn't there from the start but got added later. cheers, Gerd