diff options
-rw-r--r-- | hw/i386/pc_piix.c | 10 | ||||
-rw-r--r-- | hw/i386/pc_q35.c | 7 | ||||
-rw-r--r-- | hw/misc/pvpanic.c | 25 |
3 files changed, 18 insertions, 24 deletions
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 1329f970a9..55c24f2f6f 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -56,7 +56,7 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 }; static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 }; static const int ide_irq[MAX_IDE_BUS] = { 14, 15 }; -static bool has_pvpanic = true; +static bool has_pvpanic; static bool has_pci_info = true; /* PC hardware initialisation */ @@ -103,7 +103,6 @@ static void pc_init1(MemoryRegion *system_memory, OBJECT(icc_bridge), NULL); pc_cpus_init(cpu_model, icc_bridge); - pc_acpi_init("acpi-dsdt.aml"); if (kvm_enabled() && kvmclock_enabled) { kvmclock_create(); @@ -253,6 +252,7 @@ static void pc_init_pci(QEMUMachineInitArgs *args) static void pc_init_pci_1_6(QEMUMachineInitArgs *args) { has_pci_info = false; + has_pvpanic = true; pc_init_pci(args); } @@ -263,10 +263,10 @@ static void pc_init_pci_1_5(QEMUMachineInitArgs *args) static void pc_init_pci_1_4(QEMUMachineInitArgs *args) { - has_pvpanic = false; x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE); x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ); - pc_init_pci_1_5(args); + has_pci_info = false; + pc_init_pci(args); } static void pc_init_pci_1_3(QEMUMachineInitArgs *args) @@ -297,7 +297,6 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args) const char *kernel_cmdline = args->kernel_cmdline; const char *initrd_filename = args->initrd_filename; const char *boot_device = args->boot_device; - has_pvpanic = false; has_pci_info = false; disable_kvm_pv_eoi(); enable_compat_apic_id_mode(); @@ -316,7 +315,6 @@ static void pc_init_isa(QEMUMachineInitArgs *args) const char *kernel_cmdline = args->kernel_cmdline; const char *initrd_filename = args->initrd_filename; const char *boot_device = args->boot_device; - has_pvpanic = false; has_pci_info = false; if (cpu_model == NULL) cpu_model = "486"; diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 1d84ead9ee..bd250718fb 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -46,7 +46,7 @@ /* ICH9 AHCI has 6 ports */ #define MAX_SATA_PORTS 6 -static bool has_pvpanic = true; +static bool has_pvpanic; static bool has_pci_info = true; /* PC hardware initialisation */ @@ -221,6 +221,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args) static void pc_q35_init_1_6(QEMUMachineInitArgs *args) { has_pci_info = false; + has_pvpanic = true; pc_q35_init(args); } @@ -231,10 +232,10 @@ static void pc_q35_init_1_5(QEMUMachineInitArgs *args) static void pc_q35_init_1_4(QEMUMachineInitArgs *args) { - has_pvpanic = false; x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE); x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ); - pc_q35_init_1_5(args); + has_pci_info = false; + pc_q35_init(args); } static QEMUMachine pc_q35_machine_v1_6 = { diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index 7bb49a574f..b64e3bb7b4 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -97,29 +97,24 @@ static void pvpanic_isa_realizefn(DeviceState *dev, Error **errp) { ISADevice *d = ISA_DEVICE(dev); PVPanicState *s = ISA_PVPANIC_DEVICE(dev); + FWCfgState *fw_cfg = fw_cfg_find(); + uint16_t *pvpanic_port; - isa_register_ioport(d, &s->io, s->ioport); -} + if (!fw_cfg) { + return; + } -static void pvpanic_fw_cfg(ISADevice *dev, FWCfgState *fw_cfg) -{ - PVPanicState *s = ISA_PVPANIC_DEVICE(dev); - uint16_t *pvpanic_port = g_malloc(sizeof(*pvpanic_port)); + pvpanic_port = g_malloc(sizeof(*pvpanic_port)); *pvpanic_port = cpu_to_le16(s->ioport); - fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", pvpanic_port, sizeof(*pvpanic_port)); + + isa_register_ioport(d, &s->io, s->ioport); } void pvpanic_init(ISABus *bus) { - ISADevice *dev; - FWCfgState *fw_cfg = fw_cfg_find(); - if (!fw_cfg) { - return; - } - dev = isa_create_simple (bus, TYPE_ISA_PVPANIC_DEVICE); - pvpanic_fw_cfg(dev, fw_cfg); + isa_create_simple(bus, TYPE_ISA_PVPANIC_DEVICE); } static Property pvpanic_isa_properties[] = { @@ -132,8 +127,8 @@ static void pvpanic_isa_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = pvpanic_isa_realizefn; - dc->no_user = 1; dc->props = pvpanic_isa_properties; + set_bit(DEVICE_CATEGORY_MISC, dc->categories); } static TypeInfo pvpanic_isa_info = { |