diff options
author | Marcel Apfelbaum <marcel.a@redhat.com> | 2014-03-05 19:30:45 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2014-03-12 20:13:02 +0100 |
commit | 36d20cb2b39311869b061e1669cb55ccbf0af759 (patch) | |
tree | aadf05af30256ed9e1da1073a16c803b85b92ac3 /hw/core | |
parent | 49649f23db977137c031a21eee2f0521404f6710 (diff) | |
download | qemu-36d20cb2b39311869b061e1669cb55ccbf0af759.tar.gz qemu-36d20cb2b39311869b061e1669cb55ccbf0af759.tar.bz2 qemu-36d20cb2b39311869b061e1669cb55ccbf0af759.zip |
hw/core: Introduce QEMU machine as QOM object
The main functional change is to convert QEMUMachine into MachineClass
and QEMUMachineInitArgs into MachineState, instance of MachineClass.
As a first step, in order to make possible an incremental development,
both QEMUMachine and QEMUMachineInitArgs are being embedded into the
new types.
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/core')
-rw-r--r-- | hw/core/Makefile.objs | 2 | ||||
-rw-r--r-- | hw/core/machine.c | 28 |
2 files changed, 29 insertions, 1 deletions
diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs index 9e324befd6..981593c7e6 100644 --- a/hw/core/Makefile.objs +++ b/hw/core/Makefile.objs @@ -8,7 +8,7 @@ common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o common-obj-$(CONFIG_XILINX_AXI) += stream.o common-obj-$(CONFIG_PTIMER) += ptimer.o common-obj-$(CONFIG_SOFTMMU) += sysbus.o +common-obj-$(CONFIG_SOFTMMU) += machine.o common-obj-$(CONFIG_SOFTMMU) += null-machine.o common-obj-$(CONFIG_SOFTMMU) += loader.o common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.o - diff --git a/hw/core/machine.c b/hw/core/machine.c new file mode 100644 index 0000000000..d3ffef7e07 --- /dev/null +++ b/hw/core/machine.c @@ -0,0 +1,28 @@ +/* + * QEMU Machine + * + * Copyright (C) 2014 Red Hat Inc + * + * Authors: + * Marcel Apfelbaum <marcel.a@redhat.com> + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "hw/boards.h" + +static const TypeInfo machine_info = { + .name = TYPE_MACHINE, + .parent = TYPE_OBJECT, + .abstract = true, + .class_size = sizeof(MachineClass), + .instance_size = sizeof(MachineState), +}; + +static void machine_register_types(void) +{ + type_register_static(&machine_info); +} + +type_init(machine_register_types) |