From: "Andreas Färber" <afaerber@suse.de>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: ehabkost@redhat.com, "Michael S. Tsirkin" <mst@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
qemu-devel@nongnu.org, pbonzini@redhat.com, imammedo@redhat.com,
Borislav Petkov <bp@suse.de>
Subject: Re: [Qemu-devel] [PATCH qom-cpu for-1.5 0/4] target-i386: X86CPU compatibility properties
Date: Fri, 03 May 2013 19:26:55 +0200 [thread overview]
Message-ID: <5183F35F.7040404@suse.de> (raw)
In-Reply-To: <87sj24ko3g.fsf@codemonkey.ws>
Am 03.05.2013 18:46, schrieb Anthony Liguori:
> Andreas Färber <afaerber@suse.de> writes:
>
>> Hello,
>>
>> 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[0].model
>
> 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
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-05-03 17:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-01 16:07 [Qemu-devel] [PATCH qom-cpu for-1.5 0/4] target-i386: X86CPU compatibility properties Andreas Färber
2013-05-01 16:07 ` [Qemu-devel] [PATCH qom-cpu for-1.5 1/4] qdev: Let qdev_prop_parse() pass through Error Andreas Färber
2013-05-02 18:55 ` Eduardo Habkost
2013-05-01 16:07 ` [Qemu-devel] [PATCH qom-cpu for-1.5 2/4] qdev: Introduce qdev_prop_set_custom_globals() Andreas Färber
2013-05-02 19:08 ` Eduardo Habkost
2013-05-06 17:50 ` Andreas Färber
2013-05-01 16:07 ` [Qemu-devel] [PATCH qom-cpu for-1.5 3/4] target-i386: Emulate X86CPU subclasses for global properties Andreas Färber
2013-05-02 15:03 ` Eduardo Habkost
2013-05-01 16:07 ` [Qemu-devel] [PATCH qom-cpu for-1.5 4/4] target-i386: Change CPUID model of 486 to 8 Andreas Färber
2013-05-02 15:48 ` Eduardo Habkost
2013-05-03 16:46 ` [Qemu-devel] [PATCH qom-cpu for-1.5 0/4] target-i386: X86CPU compatibility properties Anthony Liguori
2013-05-03 17:11 ` Igor Mammedov
2013-05-03 17:26 ` Andreas Färber [this message]
2013-05-06 18:22 ` Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5183F35F.7040404@suse.de \
--to=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=bp@suse.de \
--cc=ehabkost@redhat.com \
--cc=hpa@zytor.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).