Populate the default_bus_types list for the PC machines. This will allow qmp-machine-info.py to run in strict mode for x86.
Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- hw/i386/pc_piix.c | 13 +++++++++++++ hw/i386/pc_q35.c | 4 ++++ tests/qmp-machine-info.py | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index a54a468..055f46a 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -435,6 +435,11 @@ static void pc_i440fx_machine_options(MachineClass *m) m->hot_add_cpu = pc_hot_add_cpu; m->default_machine_opts = "firmware=bios-256k.bin"; m->default_display = "std"; + machine_class_add_default_bus(m, "floppy-bus"); //FIXME: use macro + machine_class_add_default_bus(m, "i2c-bus"); //FIXME: use macro + machine_class_add_default_bus(m, TYPE_PCI_BUS); + machine_class_add_default_bus(m, TYPE_ISA_BUS); + machine_class_add_default_bus(m, "IDE");//FIXME: use macro } static void pc_i440fx_2_8_machine_options(MachineClass *m) @@ -1079,6 +1084,9 @@ static void isapc_machine_options(MachineClass *m) m->max_cpus = 1; m->option_rom_has_mr = true; m->rom_file_has_mr = false; + machine_class_add_default_bus(m, "floppy-bus"); //FIXME: use macro + machine_class_add_default_bus(m, TYPE_ISA_BUS); + machine_class_add_default_bus(m, "IDE");//FIXME: use macro pcmc->pci_enabled = false; pcmc->has_acpi_build = false; pcmc->smbios_defaults = false; @@ -1098,6 +1106,11 @@ static void xenfv_machine_options(MachineClass *m) m->max_cpus = HVM_MAX_VCPUS; m->default_machine_opts = "accel=xen"; m->hot_add_cpu = pc_hot_add_cpu; + machine_class_add_default_bus(m, "floppy-bus"); //FIXME: use macro + machine_class_add_default_bus(m, "i2c-bus"); //FIXME: use macro + machine_class_add_default_bus(m, TYPE_PCI_BUS); + machine_class_add_default_bus(m, TYPE_ISA_BUS); + machine_class_add_default_bus(m, "IDE");//FIXME: use macro } DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init, diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index b40d19e..4602852 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -292,6 +292,10 @@ static void pc_q35_machine_options(MachineClass *m) m->no_floppy = 1; m->has_dynamic_sysbus = true; m->max_cpus = 288; + machine_class_add_default_bus(m, "i2c-bus"); //FIXME: use macro + machine_class_add_default_bus(m, TYPE_PCIE_BUS); + machine_class_add_default_bus(m, TYPE_ISA_BUS); + machine_class_add_default_bus(m, "IDE");//FIXME: use macro } static void pc_q35_2_8_machine_options(MachineClass *m) diff --git a/tests/qmp-machine-info.py b/tests/qmp-machine-info.py index 5258434..a43cd1b 100755 --- a/tests/qmp-machine-info.py +++ b/tests/qmp-machine-info.py @@ -12,7 +12,7 @@ logger = logging.getLogger('qemu.tests.machineinfo') BLACKLIST = set(['xenpv', 'xenfv']) # architectures where machines are expected to report all available buses: -STRICT_ARCHES = set() +STRICT_ARCHES = set(['x86_64', 'i386']) class QueryMachinesTest(unittest.TestCase): def walkQOMTree(self, vm, path): -- 2.7.4