mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
s390x: Convert QEMUMachine to MachineClass
This converts s390-virtio and s390-ccw-virtio machines to QOM MachineClass. This brings ability to add interfaces to the machine classes. The first interface for addition will be NMI. The patch is mechanical so no change in behavior is expected. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
9cb805fd26
commit
d07aa7c7bb
2 changed files with 58 additions and 37 deletions
|
@ -51,6 +51,7 @@
|
|||
|
||||
#define MAX_BLK_DEVS 10
|
||||
#define ZIPL_FILENAME "s390-zipl.rom"
|
||||
#define TYPE_S390_MACHINE "s390-machine"
|
||||
|
||||
static VirtIOS390Bus *s390_bus;
|
||||
static S390CPU **ipi_states;
|
||||
|
@ -279,25 +280,34 @@ static void s390_init(MachineState *machine)
|
|||
s390_create_virtio_net((BusState *)s390_bus, "virtio-net-s390");
|
||||
}
|
||||
|
||||
static QEMUMachine s390_machine = {
|
||||
.name = "s390-virtio",
|
||||
.alias = "s390",
|
||||
.desc = "VirtIO based S390 machine",
|
||||
.init = s390_init,
|
||||
.block_default_type = IF_VIRTIO,
|
||||
.no_cdrom = 1,
|
||||
.no_floppy = 1,
|
||||
.no_serial = 1,
|
||||
.no_parallel = 1,
|
||||
.no_sdcard = 1,
|
||||
.use_virtcon = 1,
|
||||
.max_cpus = 255,
|
||||
.is_default = 1,
|
||||
};
|
||||
|
||||
static void s390_machine_init(void)
|
||||
static void s390_machine_class_init(ObjectClass *oc, void *data)
|
||||
{
|
||||
qemu_register_machine(&s390_machine);
|
||||
MachineClass *mc = MACHINE_CLASS(oc);
|
||||
|
||||
mc->name = "s390-virtio";
|
||||
mc->alias = "s390";
|
||||
mc->desc = "VirtIO based S390 machine";
|
||||
mc->init = s390_init;
|
||||
mc->block_default_type = IF_VIRTIO;
|
||||
mc->max_cpus = 255;
|
||||
mc->no_serial = 1;
|
||||
mc->no_parallel = 1;
|
||||
mc->use_virtcon = 1;
|
||||
mc->no_floppy = 1;
|
||||
mc->no_cdrom = 1;
|
||||
mc->no_sdcard = 1;
|
||||
mc->is_default = 1;
|
||||
}
|
||||
|
||||
machine_init(s390_machine_init);
|
||||
static const TypeInfo s390_machine_info = {
|
||||
.name = TYPE_S390_MACHINE,
|
||||
.parent = TYPE_MACHINE,
|
||||
.class_init = s390_machine_class_init,
|
||||
};
|
||||
|
||||
static void s390_machine_register_types(void)
|
||||
{
|
||||
type_register_static(&s390_machine_info);
|
||||
}
|
||||
|
||||
type_init(s390_machine_register_types)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue