From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQDqp-0006St-CP for qemu-devel@nongnu.org; Wed, 28 Jun 2017 10:21:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQDqm-0005xH-8Q for qemu-devel@nongnu.org; Wed, 28 Jun 2017 10:21:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43836) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dQDqm-0005wc-3O for qemu-devel@nongnu.org; Wed, 28 Jun 2017 10:21:48 -0400 References: <20170621113600.GA3928@thinpad.lan.raisama.net> <8135ff45-0341-1fd4-ada9-4527c6b61e5a@ilande.co.uk> <20170621132317.GD3928@thinpad.lan.raisama.net> <7b431646-019e-dce2-6345-bdbaba7ce821@ilande.co.uk> <20170623115051.GE20956@localhost.localdomain> <20170623161043.GA10204@localhost.localdomain> <60e57713-c9ce-2bf4-db6e-23686fcc955b@redhat.com> <20170623185000.GA3038@localhost.localdomain> <120b9dac-982b-1e3b-662f-e60110b3d730@ilande.co.uk> <20170627004930.GI12152@localhost.localdomain> <20170628161247.168c4acb@nial.brq.redhat.com> From: Laszlo Ersek Message-ID: Date: Wed, 28 Jun 2017 16:21:40 +0200 MIME-Version: 1.0 In-Reply-To: <20170628161247.168c4acb@nial.brq.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv6 3/5] fw_cfg: move assert() and linking of fw_cfg device to the machine into instance_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , Mark Cave-Ayland Cc: Eduardo Habkost , peter.maydell@linaro.org, mst@redhat.com, somlo@cmu.edu, qemu-devel@nongnu.org, rjones@redhat.com, pbonzini@redhat.com On 06/28/17 16:12, Igor Mammedov wrote: > On Wed, 28 Jun 2017 08:09:35 +0100 > Mark Cave-Ayland wrote: >> 1) Alter fw_cfg_find() to use object_resolve_path_type("", TYPE_FW_CFG, >> NULL) > I'd make use of the 3rd argument &ambiguous and assert on it I vaguely recall playing with "ambiguous" in find_vmgenid_dev(), but it didn't work as I expected (or, it wasn't necessary to use). Not sure about the details, I only remember that, when calling object_resolve_path_type() like above, from within a realize function, the object under realization is already considered existent, so if we're realizing the second (or later) instance of the class, object_resolve_path_type() will return NULL (regardless of "ambiguous"). If we're realizing the very first instance, then object_resolve_path_type() will return non-NULL. I don't mind "ambiguous" if it can be made work fine, just thought that I'd add this tidbit. Thanks, Laszlo