[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v2 08/39] pc: Register machine classes directly in
From: |
Andreas Färber |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
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 <address@hidden>
> Cc: Igor Mammedov <address@hidden>
> ---
> 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
- [Qemu-devel] [RFC v2 00/39] Convert PC machine-types to QOM classes, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 01/39] q35: Use PC_Q35_COMPAT_1_4 on pc-q35-1.4 compat_props, Eduardo Habkost, 2014/06/13
- [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
- [Qemu-devel] [RFC v2 02/39] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14, Eduardo Habkost, 2014/06/13
- [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
- [Qemu-devel] [RFC v2 06/39] vl.c: Use qdev_prop_register_global() for single globals, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 07/39] machine: Make compat_props a linked list, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 08/39] pc: Register machine classes directly instead of using QEMUMachine, Eduardo Habkost, 2014/06/13
- Re: [Qemu-devel] [RFC v2 08/39] pc: Register machine classes directly instead of using QEMUMachine,
Andreas Färber <=
- [Qemu-devel] [RFC v2 10/39] pc: Eliminate pc_default_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 09/39] pc: Eliminate pc_common_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 11/39] piix: Eliminate pc_i440fx_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 13/39] q35: Eliminate pc_q35_1_4_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 12/39] q35: Eliminate pc_q35_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 14/39] pc: Eliminate *machine_options macros, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 15/39] piix: Make all *machine_options() functions call the previous one, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 16/39] pc: Eliminate all *_machine_options() functions, Eduardo Habkost, 2014/06/13