[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/21] arm: virt: Move machine class init code to the
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 05/21] arm: virt: Move machine class init code to the abstract machine type |
Date: |
Wed, 16 Mar 2016 17:18:19 +0000 |
From: Wei Huang <address@hidden>
This patch moves the common class initialization code from
"virt-2.6" to the new abstract class. An empty property is added to
"virt-2.6" machine. In the meanwhile, related funtions are renamed
to "virt_2_6_*" for consistency.
Signed-off-by: Wei Huang <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
hw/arm/virt.c | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index be9bbfb..8c3ac0d 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1347,6 +1347,18 @@ static void virt_set_gic_version(Object *obj, const char
*value, Error **errp)
static void virt_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
+ mc->init = machvirt_init;
+ /* Start max_cpus at the maximum QEMU supports. We'll further restrict
+ * it later in machvirt_init, where we have more information about the
+ * configuration of the particular instance.
+ */
+ mc->max_cpus = MAX_CPUMASK_BITS;
+ mc->has_dynamic_sysbus = true;
+ mc->block_default_type = IF_VIRTIO;
+ mc->no_cdrom = 1;
+ mc->pci_allow_0_address = true;
}
static const TypeInfo virt_machine_info = {
@@ -1358,7 +1370,7 @@ static const TypeInfo virt_machine_info = {
.class_init = virt_machine_class_init,
};
-static void virt_instance_init(Object *obj)
+static void virt_2_6_instance_init(Object *obj)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -1391,29 +1403,23 @@ static void virt_instance_init(Object *obj)
"Valid values are 2, 3 and host", NULL);
}
-static void virt_class_init(ObjectClass *oc, void *data)
+static void virt_2_6_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
+ static GlobalProperty compat_props[] = {
+ { /* end of list */ }
+ };
mc->desc = "QEMU 2.6 ARM Virtual Machine";
mc->alias = "virt";
- mc->init = machvirt_init;
- /* Start max_cpus at the maximum QEMU supports. We'll further restrict
- * it later in machvirt_init, where we have more information about the
- * configuration of the particular instance.
- */
- mc->max_cpus = MAX_CPUMASK_BITS;
- mc->has_dynamic_sysbus = true;
- mc->block_default_type = IF_VIRTIO;
- mc->no_cdrom = 1;
- mc->pci_allow_0_address = true;
+ mc->compat_props = compat_props;
}
static const TypeInfo machvirt_info = {
.name = MACHINE_TYPE_NAME("virt-2.6"),
.parent = TYPE_VIRT_MACHINE,
- .instance_init = virt_instance_init,
- .class_init = virt_class_init,
+ .instance_init = virt_2_6_instance_init,
+ .class_init = virt_2_6_class_init,
};
static void machvirt_machine_init(void)
--
1.9.1
- [Qemu-devel] [PULL 00/21] target-arm queue, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 16/21] bcm2835_peripherals: enable sdhci pending-insert quirk for raspberry pi, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 15/21] hw/arm: Add palmetto-bmc machine, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 14/21] hw/arm: Add ASPEED AST2400 SoC model, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 03/21] target-arm: Fix translation level on early translation faults, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 09/21] i.MX: Add the CLK_IPG_HIGH clock, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 07/21] i.MX: Rename CCM NOCLK to CLK_NONE for naming consistency., Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 05/21] arm: virt: Move machine class init code to the abstract machine type,
Peter Maydell <=
- [Qemu-devel] [PULL 08/21] i.MX: Remove CCM useless clock computation handling., Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 11/21] i.MX: Add missing descriptions in devices., Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 21/21] sd: Fix "info qtree" on boards with SD cards, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 17/21] bcm2835_aux: add emulation of BCM2835 AUX (aka UART1) block, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 19/21] bcm2835_property: implement framebuffer control/configuration properties, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 02/21] target-arm: Implement MRS (banked) and MSR (banked) instructions, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 12/21] hw/timer: Add ASPEED timer device model, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 04/21] arm: virt: Add an abstract ARM virt machine type, Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 06/21] i.MX: Allow GPT timer to rollover., Peter Maydell, 2016/03/16
- [Qemu-devel] [PULL 01/21] loader: Fix incorrect parameter name in load_image_mr() macro, Peter Maydell, 2016/03/16