Received: from eggs.gnu.org ([2001:4830:134:3::10]:46752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3DZQ-00022s-QN for qemu-devel@nongnu.org; Fri, 04 Jul 2014 20:11:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X3DZK-0005BU-KS for qemu-devel@nongnu.org; Fri, 04 Jul 2014 20:11:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3DZK-0005BL-Bs for qemu-devel@nongnu.org; Fri, 04 Jul 2014 20:11:06 -0400 From: Eduardo Habkost Date: Fri, 4 Jul 2014 21:09:40 -0300 Message-Id: <1404519002-10224-14-git-send-email-ehabkost@redhat.com> In-Reply-To: <1404519002-10224-1-git-send-email-ehabkost@redhat.com> References: <1404519002-10224-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [RFC v3 13/35] pc: Eliminate pc_default_machine_options() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , "Michael S. Tsirkin" , Alexander Graf , Don Slutz , Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= The only PC machines that didn't call pc_default_machine_options() were isaps and xenfv. Both were already overwriting max_cpus, and only isapc was not overwriting hot_add_cpu. After making isapc set hot_add_cpu to NULL, we can move the pc_default_machine_options() code the PC common class_init. Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 2 ++ hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 1 - include/hw/i386/pc.h | 6 ------ 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index d812ab7..7a6aa66 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1664,6 +1664,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->get_hotplug_handler = mc->get_hotplug_handler; mc->get_hotplug_handler = pc_get_hotpug_handler; mc->default_boot_order = "cad"; + mc->hot_add_cpu = pc_hot_add_cpu; + mc->max_cpus = 255; hc->plug = pc_machine_device_plug_cb; } diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 16c948a..dab2085 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -434,7 +434,6 @@ static void pc_xen_hvm_init(MachineState *machine) 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; } @@ -997,6 +996,7 @@ static void isapc_machine_class_init(ObjectClass *oc, void *data) mc->desc = "ISA-only PC"; mc->init = pc_init_isa; mc->max_cpus = 1; + mc->hot_add_cpu = NULL; mc->name = "isapc"; machine_class_add_compat_props(mc, compat_props); } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index f97bd8a..29bc4db 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -340,7 +340,6 @@ static void pc_q35_init_1_4(MachineState *machine) static void pc_q35_machine_options(MachineClass *mc) { - pc_default_machine_options(mc); mc->desc = "Standard PC (Q35 + ICH9, 2009)"; mc->hot_add_cpu = pc_hot_add_cpu; } diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 5d5d193..e140b1e 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -500,10 +500,4 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .value = stringify(0),\ } -static inline void pc_default_machine_options(MachineClass *mc) -{ - mc->hot_add_cpu = pc_hot_add_cpu; - mc->max_cpus = 255; -} - #endif -- 1.9.3