From: Anthony Liguori <aliguori@us.ibm.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH 0/5]: Improve machine type functions
Date: Fri, 24 Feb 2012 08:58:55 -0600 [thread overview]
Message-ID: <4F47A5AF.5070707@us.ibm.com> (raw)
In-Reply-To: <1330092792-22455-1-git-send-email-lcapitulino@redhat.com>
On 02/24/2012 08:13 AM, Luiz Capitulino wrote:
> I was reading some related code yesterday and couldn't resist improving this.
> Not sure if this is aligned with any possible QOM work in this area, but I'm
> posting this anyway...
I'm not sure how easy this is, but the way to do this with QOM would be:
1) Introduce a Machine abstract type. It would have the normal properties for
the various machine parameters we have today (that are standard for all machines).
2) Convert all the registered users of QEMUMachine to subtypes of Machine. Note
that this would tremendously simplify PC since each version could subclass the
previous and we wouldn't need to duplicate globals. Use a realize() method to
trigger what we think of as the machine->init() function today (but it would
take no parameters).
3) Change machine listing to a object_type_foreach() call that passed
TYPE_MACHINE for 'implements'.
4) Change machine initialization to creating an object of type (3), setting the
properties appropriately, and then calling the realize() method of the object.
That's not to say this series isn't a good cleanup. I haven't actually reviewed
it yet. I just wanted to illustrate the next QOM steps.
Regards,
Anthony Liguori
>
> Makefile.target | 3 +-
> hw/alpha_dp264.c | 2 +-
> hw/an5206.c | 2 +-
> hw/axis_dev88.c | 2 +-
> hw/boards.c | 86 +++++++++++++++++++++++++++++++++++++++++
> hw/boards.h | 9 +++-
> hw/collie.c | 2 +-
> hw/dummy_m68k.c | 2 +-
> hw/exynos4_boards.c | 4 +-
> hw/gumstix.c | 4 +-
> hw/highbank.c | 2 +-
> hw/integratorcp.c | 2 +-
> hw/leon3.c | 2 +-
> hw/lm32_boards.c | 4 +-
> hw/mainstone.c | 2 +-
> hw/mcf5208.c | 2 +-
> hw/milkymist.c | 2 +-
> hw/mips_fulong2e.c | 2 +-
> hw/mips_jazz.c | 4 +-
> hw/mips_malta.c | 2 +-
> hw/mips_mipssim.c | 2 +-
> hw/mips_r4k.c | 2 +-
> hw/musicpal.c | 2 +-
> hw/nseries.c | 4 +-
> hw/omap_sx1.c | 4 +-
> hw/palm.c | 2 +-
> hw/pc_piix.c | 20 +++++-----
> hw/pc_sysfw.c | 2 +-
> hw/petalogix_ml605_mmu.c | 2 +-
> hw/petalogix_s3adsp1800_mmu.c | 2 +-
> hw/ppc405_boards.c | 4 +-
> hw/ppc440_bamboo.c | 2 +-
> hw/ppc_newworld.c | 2 +-
> hw/ppc_oldworld.c | 2 +-
> hw/ppc_prep.c | 2 +-
> hw/ppce500_mpc8544ds.c | 2 +-
> hw/r2d.c | 2 +-
> hw/realview.c | 8 ++--
> hw/s390-virtio.c | 2 +-
> hw/shix.c | 2 +-
> hw/spapr.c | 2 +-
> hw/spitz.c | 8 ++--
> hw/stellaris.c | 4 +-
> hw/sun4m.c | 24 ++++++------
> hw/sun4u.c | 6 +-
> hw/tosa.c | 2 +-
> hw/versatilepb.c | 4 +-
> hw/vexpress.c | 4 +-
> hw/virtex_ml507.c | 2 +-
> hw/xen_machine_pv.c | 2 +-
> hw/xtensa_lx60.c | 4 +-
> hw/xtensa_sim.c | 2 +-
> hw/z2.c | 2 +-
> vl.c | 65 +------------------------------
> 54 files changed, 184 insertions(+), 157 deletions(-)
>
next prev parent reply other threads:[~2012-02-24 14:59 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 14:13 [Qemu-devel] [PATCH 0/5]: Improve machine type functions Luiz Capitulino
2012-02-24 14:13 ` [Qemu-devel] [PATCH 1/5] boards: qemu_register_machine(): return void Luiz Capitulino
2012-02-24 14:17 ` Andreas Färber
2012-02-24 14:13 ` [Qemu-devel] [PATCH 2/5] boards: rename machine type functions Luiz Capitulino
2012-02-24 16:12 ` Peter Maydell
2012-02-24 16:15 ` Anthony Liguori
2012-02-24 16:51 ` Luiz Capitulino
2012-02-24 16:57 ` Anthony Liguori
2012-02-24 14:13 ` [Qemu-devel] [PATCH 3/5] boards: introduce machine_print_all() Luiz Capitulino
2012-02-24 14:26 ` Andreas Färber
2012-02-24 14:57 ` Luiz Capitulino
2012-02-24 14:13 ` [Qemu-devel] [PATCH 4/5] boards: switch machine type list to QTAILQ Luiz Capitulino
2012-02-24 14:23 ` Andreas Färber
2012-02-24 14:56 ` Luiz Capitulino
2012-02-24 15:21 ` Andreas Färber
2012-02-24 15:23 ` Luiz Capitulino
2012-02-24 14:13 ` [Qemu-devel] [PATCH 5/5] boards: move all machine type functions to boards.c Luiz Capitulino
2012-02-24 15:10 ` Andreas Färber
2012-02-24 15:22 ` Luiz Capitulino
2012-02-24 14:58 ` Anthony Liguori [this message]
2012-02-24 15:20 ` [Qemu-devel] [PATCH 0/5]: Improve machine type functions Luiz Capitulino
2012-02-24 15:44 ` Anthony Liguori
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=4F47A5AF.5070707@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=afaerber@suse.de \
--cc=lcapitulino@redhat.com \
--cc=peter.maydell@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.