qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/4] pc: add 2.3 machine types


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH 1/4] pc: add 2.3 machine types
Date: Fri, 5 Dec 2014 16:14:30 -0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Fri, Dec 05, 2014 at 06:44:23PM +0100, Paolo Bonzini wrote:
> The next patch will differentiate them.
> 
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  hw/i386/pc_piix.c | 28 +++++++++++++++++++++++++---
>  hw/i386/pc_q35.c  | 25 ++++++++++++++++++++++---
>  2 files changed, 47 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 741dffd..5ad23d0 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -303,6 +303,10 @@ static void pc_init_pci(MachineState *machine)
>      pc_init1(machine, 1, 1);
>  }
>  
> +static void pc_compat_2_2(MachineState *machine)
> +{
> +}
> +
>  static void pc_compat_2_1(MachineState *machine)
>  {
>      PCMachineState *pcms = PC_MACHINE(machine);

You need to make pc_compat_2_1() call pc_compat_2_2(). The same on
pc_q35.c.

> @@ -380,6 +384,12 @@ static void pc_compat_1_2(MachineState *machine)
>      x86_cpu_compat_kvm_no_autoenable(FEAT_KVM, KVM_FEATURE_PV_EOI);
>  }
>  
> +static void pc_init_pci_2_2(MachineState *machine)
> +{
> +    pc_compat_2_2(machine);
> +    pc_init_pci(machine);
> +}
> +
>  static void pc_init_pci_2_1(MachineState *machine)
>  {
>      pc_compat_2_1(machine);
> @@ -473,6 +483,19 @@ static void pc_xen_hvm_init(MachineState *machine)
>      .desc = "Standard PC (i440FX + PIIX, 1996)", \
>      .hot_add_cpu = pc_hot_add_cpu
>  
> +#define PC_I440FX_2_3_MACHINE_OPTIONS                           \
> +    PC_I440FX_MACHINE_OPTIONS,                                  \
> +    .default_machine_opts = "firmware=bios-256k.bin",           \
> +    .default_display = "std"
> +
> +static QEMUMachine pc_i440fx_machine_v2_3 = {
> +    PC_I440FX_2_3_MACHINE_OPTIONS,
> +    .name = "pc-i440fx-2.3",
> +    .alias = "pc",
> +    .init = pc_init_pci,
> +    .is_default = 1,
> +};
> +
>  #define PC_I440FX_2_2_MACHINE_OPTIONS                           \
>      PC_I440FX_MACHINE_OPTIONS,                                  \

I was going to suggest making PC_I440FX_2_2_MACHINE_OPTIONS reuse
PC_I440FX_2_3_MACHINE_OPTIONS, but I think we have enough macro reuse
mess here, and this is safer and simpler?

>      .default_machine_opts = "firmware=bios-256k.bin",           \
> @@ -481,9 +504,7 @@ static void pc_xen_hvm_init(MachineState *machine)
>  static QEMUMachine pc_i440fx_machine_v2_2 = {
>      PC_I440FX_2_2_MACHINE_OPTIONS,
>      .name = "pc-i440fx-2.2",
> -    .alias = "pc",
> -    .init = pc_init_pci,
> -    .is_default = 1,
> +    .init = pc_init_pci_2_2,
>  };
>  
[...]

-- 
Eduardo



reply via email to

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