From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYJl7-0004bJ-OK for qemu-devel@nongnu.org; Fri, 03 May 2013 13:27:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYJl6-0007iz-Jn for qemu-devel@nongnu.org; Fri, 03 May 2013 13:27:01 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42746 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYJl6-0007it-A5 for qemu-devel@nongnu.org; Fri, 03 May 2013 13:27:00 -0400 Message-ID: <5183F35F.7040404@suse.de> Date: Fri, 03 May 2013 19:26:55 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1367424440-16687-1-git-send-email-afaerber@suse.de> <87sj24ko3g.fsf@codemonkey.ws> In-Reply-To: <87sj24ko3g.fsf@codemonkey.ws> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu for-1.5 0/4] target-i386: X86CPU compatibility properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: ehabkost@redhat.com, "Michael S. Tsirkin" , "H. Peter Anvin" , qemu-devel@nongnu.org, pbonzini@redhat.com, imammedo@redhat.com, Borislav Petkov Am 03.05.2013 18:46, schrieb Anthony Liguori: > Andreas F=C3=A4rber writes: >=20 >> Hello, >> >> It's easier adapting the infrastructure to our needs than working arou= nd it: >> X86CPU already has QOM properties today. What's lacking is model subcl= asses, >> and with the one X86CPU type its global properties are overwritten by = models. >> But we already know the designated naming scheme for the models! >> >> So let's simply prepare compat_props for CPU models and make sure they= are >> already picked up today. >> >> This works just fine for changing the 486 CPUID model value and avoids= to >> redo the PC part once we have X86CPU subclasses. >> Tested using: ./QMP/qom-get /machine/icc-bridge/icc/child[0].model >=20 > So, what's left to do with subclass modelling? Well, in the past there had been multiple approaches: X86CPUInfo (me) instance_init (proposed my PMM, no code) class_init (me) x86_def_t (me) static properties (imammedo) Either of the last three ran into issues/discussions for -cpu host. Igor's proposal is touching on the same issue as this series: qdev_set_global_properties() is run from device's instance_init, which is run *before* derived classes add any QOM-style properties in theirs. So for 1.6 I would rather like to amend our QOM infrastructure with an .instance_post_init hook (prior art for qdev props: .class_base_init) or otherwise allow to set global defaults for any device or QOM object than converting perfectly fine QOM properties back into qdev static properties, when it's all just for one single function call. :) > How long are we going to need to carry something like this? I've always been hoping to get subclasses done for the next release... That said, it depends on whether we can find an agreeable solution for the above when-do-we-set-globals problem. If we do need static properties, Igor has a patch to that effect that looked okay. > It's a clever work around but I'm a bit concerned that it would grow > beyond cpu subclasses and that we'd be stuck with it forever. I would've proposed to add a header comment indicating it's not to be generally used, but experience shows such comments are rarely read. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg