From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqcE5-0006oR-8U for qemu-devel@nongnu.org; Wed, 11 Dec 2013 00:20:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqcDz-000685-8z for qemu-devel@nongnu.org; Wed, 11 Dec 2013 00:20:49 -0500 Received: from mail-pb0-f51.google.com ([209.85.160.51]:50980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqcDz-00067x-2M for qemu-devel@nongnu.org; Wed, 11 Dec 2013 00:20:43 -0500 Received: by mail-pb0-f51.google.com with SMTP id up15so9266754pbc.10 for ; Tue, 10 Dec 2013 21:20:41 -0800 (PST) Message-ID: <52A7F622.4040203@ozlabs.ru> Date: Wed, 11 Dec 2013 16:20:34 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1385364460-24332-1-git-send-email-aik@ozlabs.ru> <1385364460-24332-3-git-send-email-aik@ozlabs.ru> <529DA675.8030705@redhat.com> <529DE041.70006@suse.de> <529DE3F0.2050101@redhat.com> <529DEC1A.2030306@suse.de> <529DF195.3090107@redhat.com> In-Reply-To: <529DF195.3090107@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 2/5] machine: introduce get_fw_dev_path() callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: Peter Crosthwaite , Nikunj A Dadhania , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Anthony Liguori , Paul Mackerras , =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= On 12/04/2013 01:58 AM, Paolo Bonzini wrote: > Il 03/12/2013 15:35, Andreas Färber ha scritto: >> Am 03.12.2013 15:00, schrieb Paolo Bonzini: >>> Il 03/12/2013 14:44, Andreas Färber ha scritto: >>>>>> >>>>>> You can check "if (current_machine && >>>>>> current_machine->get_fw_dev_path)", and move current_machine from vl.c >>>>>> to hw/qdev/core.c. >>>> Please don't encourage moving random stuff into "core" device code. >>>> >>>> If needed, we can easily add a machine.c, but that should remain >>>> softmmu-only. >>> >>> Another solution would be to: >>> >>> (1) add an interface which contains "get_fw_dev_path". When >>> qdev_get_fw_dev_path is called, walk the QOM tree until an object that >>> implements the interface is found. If none is found, call the bus >>> implementation as usual. >>> >>> (2) in vl.c, add a way for current_machine to override the /machine >>> object. A 100%-QOMified machine indeed could put a SOC-like Device there. >>> >>> (3) for spapr, define the machine object to something that implements >>> said interface. >>> >>> It seemed a bit complicated for this particular problem, but I cannot >>> say it's overengineered. >>> >>> More aspects of the configuration could be moved to the new interface >>> over time, for example compat properties. >> >> I remember Hervé running into problems with interfaces and ppc -cpu ? >> (or -cpu host?), which does an object_class_foreach(), in the middle of >> which QOM interfaces tried registering new types, leading to a GLib >> assertion. Anthony never replied to that patch despite repeated pings, >> so the issue is likely still unresolved. >> >> http://patchwork.ozlabs.org/patch/241072/ (proposed workaround) >> http://patchwork.ozlabs.org/patch/241504/ (test case) >> http://patchwork.ozlabs.org/patch/241073/ (actual interface attempt) > > Well, let's fix it. Thanks for the test case. Any progress on this? I am asking since the patchset about bootindex you gave me yesterday prints "(process:38896): GLib-CRITICAL **: g_hash_table_foreach: assertion `version == hash_table->version' failed" which I "fixed" by moving the machine object creation chunk before kvm_init() in vl.c. btw what do I do with that patchset now? I works for me (except the issue above), do I have to repost it again? Thanks. -- Alexey