diff --git a/devices/common/pci/pcihost.cpp b/devices/common/pci/pcihost.cpp index 5930d9f..a054b7b 100644 --- a/devices/common/pci/pcihost.cpp +++ b/devices/common/pci/pcihost.cpp @@ -24,6 +24,7 @@ along with this program. If not, see . #include #include #include +#include #include #include #include @@ -101,7 +102,10 @@ PCIDevice *PCIHost::attach_pci_device(const std::string& dev_name, int slot_id, } // attempt to create device object - auto dev_obj = DeviceRegistry::get_descriptor(dev_name).m_create_func(); + auto desc = DeviceRegistry::get_descriptor(dev_name); + map settings; + MachineFactory::get_device_settings(desc, settings); + auto dev_obj = desc.m_create_func(); if (!dev_obj->supports_type(HWCompType::PCI_DEV)) { HWComponent *hwc = dynamic_cast(this); diff --git a/machines/machinefactory.h b/machines/machinefactory.h index 565981a..f2d697d 100644 --- a/machines/machinefactory.h +++ b/machines/machinefactory.h @@ -57,6 +57,7 @@ public: static int create(string& mach_id); static int create_machine_for_id(string& id, string& rom_filepath); + static void get_device_settings(DeviceDescription& dev, map &settings); static int get_machine_settings(const string& id, map &settings); static void set_machine_settings(map &settings); @@ -67,7 +68,6 @@ private: static void create_device(string& dev_name, DeviceDescription& dev); static void print_settings(PropMap& p); static void list_device_settings(DeviceDescription& dev); - static void get_device_settings(DeviceDescription& dev, map &settings); static int load_boot_rom(string& rom_filepath); static map & get_registry() {