From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyk0h-00011B-D1 for qemu-devel@nongnu.org; Mon, 15 Jul 2013 10:44:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uyk0c-00025q-NT for qemu-devel@nongnu.org; Mon, 15 Jul 2013 10:44:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyk0c-00025c-BD for qemu-devel@nongnu.org; Mon, 15 Jul 2013 10:44:14 -0400 Message-ID: <51E40AAA.2010500@redhat.com> Date: Mon, 15 Jul 2013 16:43:54 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1373895639-21476-1-git-send-email-afaerber@suse.de> In-Reply-To: <1373895639-21476-1-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC 0/3] Recursive QOM realize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: Blue Swirl , Hu Tao , "Peter C. Crosthwaite" , qemu-devel@nongnu.org, Anthony Liguori Il 15/07/2013 15:40, Andreas F=C3=A4rber ha scritto: > Originally Paolo and me had implemented QOM realize at Object level. > Paolo's goal was to set realized =3D true on /machine and it propagatin= g from > there on. This series now implements {realize,unrealize}_children at > DeviceState level instead and propagates realized changes along busses = rather > than child<> properties. You are right that realize must be done after the bus is realized (and unrealize must be done before the bus). But I'm afraid this opens a can of worms. > On machine creation done, a depth-first search is done > for devices from /machine, which are then expected to further propagate= the > property change. How do you ensure that devices are realized before their bus's parent _and_ before their parent? With two constraints for each device, we have a graph, not anymore a tree. Example: (1) this is the composition tree /machine ,------' | '------. /pci-host /isa /superio ,----' '----. /i8254 /i8259 (2) this is the bus tree PCI (/pci-host) | ISA (/isa) ,-----------' '------. /superio/i8254 /superio/i8259 The constraints are: - pci-host before isa - superio before superio/i8254 - superio before superio/i8259 - isa before superio/i8254 - isa before superio/i8259 So the two valid orders are - /machine, pci-host, superio, isa, superio/i8254, superio/8259 - /machine, pci-host, isa, superio, superio/i8254, superio/8259 You cannot say whether superio or isa are encountered first, so you cannot say whether it is superio or isa that should "hold off" the visit of their children (in either the QOM tree or the bus tree). What avoids us having to do a full topological ordering of the graph? Paolo