mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
hw/i386: Simplify ioapic_init_gsi()
All callers of ioapic_init_gsi() provide a parent. We want new uses to follow the same good practice and provide the parent name, so do not make this optional: assert the parent name is provided, and simplify the code. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
64c033badd
commit
14a1bb48ea
1 changed files with 3 additions and 4 deletions
|
@ -307,15 +307,14 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name)
|
||||||
SysBusDevice *d;
|
SysBusDevice *d;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
assert(parent_name);
|
||||||
if (kvm_ioapic_in_kernel()) {
|
if (kvm_ioapic_in_kernel()) {
|
||||||
dev = qdev_create(NULL, TYPE_KVM_IOAPIC);
|
dev = qdev_create(NULL, TYPE_KVM_IOAPIC);
|
||||||
} else {
|
} else {
|
||||||
dev = qdev_create(NULL, TYPE_IOAPIC);
|
dev = qdev_create(NULL, TYPE_IOAPIC);
|
||||||
}
|
}
|
||||||
if (parent_name) {
|
|
||||||
object_property_add_child(object_resolve_path(parent_name, NULL),
|
object_property_add_child(object_resolve_path(parent_name, NULL),
|
||||||
"ioapic", OBJECT(dev), NULL);
|
"ioapic", OBJECT(dev), NULL);
|
||||||
}
|
|
||||||
qdev_init_nofail(dev);
|
qdev_init_nofail(dev);
|
||||||
d = SYS_BUS_DEVICE(dev);
|
d = SYS_BUS_DEVICE(dev);
|
||||||
sysbus_mmio_map(d, 0, IO_APIC_DEFAULT_ADDRESS);
|
sysbus_mmio_map(d, 0, IO_APIC_DEFAULT_ADDRESS);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue