[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qom-cpu for-1.5 0/4] target-i386: X86CPU compati
Re: [Qemu-devel] [PATCH qom-cpu for-1.5 0/4] target-i386: X86CPU compatibility properties
Fri, 03 May 2013 19:26:55 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5
Am 03.05.2013 18:46, schrieb Anthony Liguori:
> Andreas Färber <address@hidden> writes:
>> It's easier adapting the infrastructure to our needs than working around it:
>> X86CPU already has QOM properties today. What's lacking is model subclasses,
>> 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.model
> So, what's left to do with subclass modelling?
Well, in the past there had been multiple approaches:
instance_init (proposed my PMM, no code)
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.
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- Re: [Qemu-devel] [PATCH qom-cpu for-1.5 3/4] target-i386: Emulate X86CPU subclasses for global properties, (continued)
- [Qemu-devel] [PATCH qom-cpu for-1.5 2/4] qdev: Introduce qdev_prop_set_custom_globals(), Andreas Färber, 2013/05/01
- [Qemu-devel] [PATCH qom-cpu for-1.5 4/4] target-i386: Change CPUID model of 486 to 8, Andreas Färber, 2013/05/01
- [Qemu-devel] [PATCH qom-cpu for-1.5 1/4] qdev: Let qdev_prop_parse() pass through Error, Andreas Färber, 2013/05/01
- Re: [Qemu-devel] [PATCH qom-cpu for-1.5 0/4] target-i386: X86CPU compatibility properties, Anthony Liguori, 2013/05/03
- Re: [Qemu-devel] [PATCH qom-cpu for-1.5 0/4] target-i386: X86CPU compatibility properties, Andreas Färber, 2013/05/06