qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]