From: "Andreas Färber" <afaerber@suse.de>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Marcel Apfelbaum <marcel.a@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Alexander Graf <agraf@suse.de>, Don Slutz <dslutz@verizon.com>,
Anthony Liguori <aliguori@amazon.com>,
Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [RFC v2 08/39] pc: Register machine classes directly instead of using QEMUMachine
Date: Mon, 16 Jun 2014 12:36:49 +0200 [thread overview]
Message-ID: <539EC8C1.80006@suse.de> (raw)
In-Reply-To: <1402688658-22333-9-git-send-email-ehabkost@redhat.com>
Am 13.06.2014 21:43, schrieb Eduardo Habkost:
> This is a (mostly) blind and mechanical conversion of the PC QEMUMachine
> definitions to corresponding class registration code.
>
> Having the PC code converted to pure QOM registration code will help us
> move PC-specific machine state that is currently held in static
> variables inside PC machine objects, and reduce duplication between
> pc_piix.c and pc_q35.c.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> ---
> Changes v1 -> v2:
> * Remove unused PC_DEFAULT_MACHINE_OPTIONS macro leftover
> * Use machine_class_register_global_props_array()
> * Rebase on top of Michael's pci tree
> * Eliminate qemu_register_pc_machine(), as it is not needed anymore
> ---
> hw/i386/pc.c | 44 -----
> hw/i386/pc_piix.c | 473 +++++++++++++++++++++++++++++++++++----------------
> hw/i386/pc_q35.c | 171 +++++++++++++------
> include/hw/i386/pc.h | 17 +-
> 4 files changed, 448 insertions(+), 257 deletions(-)
[...]
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index dd52183..bb7a788 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -405,81 +405,140 @@ static void pc_xen_hvm_init(MachineState *machine)
> }
> #endif
>
> -#define PC_I440FX_MACHINE_OPTIONS \
> - PC_DEFAULT_MACHINE_OPTIONS, \
> - .desc = "Standard PC (i440FX + PIIX, 1996)", \
> - .hot_add_cpu = pc_hot_add_cpu
> -
> -#define PC_I440FX_2_1_MACHINE_OPTIONS \
> - PC_I440FX_MACHINE_OPTIONS, \
> - .default_machine_opts = "firmware=bios-256k.bin"
> -
> -static QEMUMachine pc_i440fx_machine_v2_1 = {
> - PC_I440FX_2_1_MACHINE_OPTIONS,
> - .name = "pc-i440fx-2.1",
> - .alias = "pc",
> - .init = pc_init_pci,
> - .is_default = 1,
> +static void pc_i440fx_machine_options(MachineClass *mc)
> +{
> + pc_default_machine_options(mc);
> + mc->desc = "Standard PC (i440FX + PIIX, 1996)";
> + mc->hot_add_cpu = pc_hot_add_cpu;
> +}
> +
> +static void pc_i440fx_2_1_machine_options(MachineClass *mc)
> +{
> + pc_i440fx_machine_options(mc);
> + mc->default_machine_opts = "firmware=bios-256k.bin";
> +}
> +
> +static void pc_i440fx_machine_v2_1_class_init(ObjectClass *oc, void *data)
> +{
> + MachineClass *mc = MACHINE_CLASS(oc);
> + pc_i440fx_2_1_machine_options(mc);
> + mc->alias = "pc";
> + mc->init = pc_init_pci;
> + mc->is_default = 1;
> + mc->name = "pc-i440fx-2.1";
> +}
> +
> +static TypeInfo pc_i440fx_machine_v2_1_type_info = {
static const TypeInfo please, or explain why not. (recurring issue)
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:[~2014-06-16 10:37 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-13 19:43 [Qemu-devel] [RFC v2 00/39] Convert PC machine-types to QOM classes Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 01/39] q35: Use PC_Q35_COMPAT_1_4 on pc-q35-1.4 compat_props Eduardo Habkost
2014-06-16 10:28 ` Andreas Färber
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 02/39] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14 Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 03/39] piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13 Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 04/39] piix: Move pc-0.1[23] rombar compat props " Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 05/39] piix: Move pc-0.11 drive version compat props TO PC_COMPAT_0_11 Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 06/39] vl.c: Use qdev_prop_register_global() for single globals Eduardo Habkost
2014-06-16 10:30 ` Andreas Färber
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 07/39] machine: Make compat_props a linked list Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 08/39] pc: Register machine classes directly instead of using QEMUMachine Eduardo Habkost
2014-06-16 10:36 ` Andreas Färber [this message]
2014-06-16 12:38 ` Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 09/39] pc: Eliminate pc_common_machine_options() Eduardo Habkost
2014-06-16 11:10 ` Andreas Färber
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 10/39] pc: Eliminate pc_default_machine_options() Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 11/39] piix: Eliminate pc_i440fx_machine_options() Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 12/39] q35: Eliminate pc_q35_machine_options() Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 13/39] q35: Eliminate pc_q35_1_4_machine_options() Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 14/39] pc: Eliminate *machine_options macros Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 15/39] piix: Make all *machine_options() functions call the previous one Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 16/39] pc: Eliminate all *_machine_options() functions Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 17/39] pc: Move pci_enabled parameter to PCMachineClass Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 18/39] q35: Use PCMachineClass.pci_enabled field Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 19/39] pc: Move kvmclock_enabled to PCMachineClass Eduardo Habkost
2014-06-13 19:43 ` [Qemu-devel] [RFC v2 20/39] pc: Move smbios_legacy_mode " Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 21/39] pc: Move smbios_defaults " Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 22/39] pc: Move has_acpi_build " Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 23/39] pc: Move has_pci_info " Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 24/39] pc: Move gigabyte_align " Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 25/39] pc: Move has_reserved_memory " Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 26/39] pc: Move option_rom_has_mr/rom_file_has_mr to MachineClass Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 27/39] piix: Eliminate pc_init_pci() Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 28/39] piix: Introduce struct PCI440FXMachineClass Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 29/39] pc: Create common machine init function Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 30/39] pc: Eliminate empty or trivial compat functions Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 31/39] piix: Move compat/init functions closer to corresponding class_init Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 32/39] pc: Rename pc_machine variable to pcms Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 33/39] pc: Move {ram, pci, rom}_memory variables to PCMachineState Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 34/39] pc: Move duplicate Xen init code to pc_machine_init() Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 35/39] pc: Move icc_bridge variable to PCMachineState Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 36/39] pc: Move duplicate icc-bridge and CPU initalization to pc_machine_init() Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 37/39] pc: Make pc_cpus_init() static Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 38/39] pc: Make pc_cpus_init() use PCMachineState Eduardo Habkost
2014-06-13 19:44 ` [Qemu-devel] [RFC v2 39/39] machine: Eliminate QEMUMachine.compat_props Eduardo Habkost
2014-06-14 3:53 ` [Qemu-devel] [RFC v2 00/39] Convert PC machine-types to QOM classes Eduardo Habkost
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=539EC8C1.80006@suse.de \
--to=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aliguori@amazon.com \
--cc=dslutz@verizon.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcel.a@redhat.com \
--cc=mst@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).