diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index 7816f10aaa1..b5f22ef2b31 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -1039,6 +1039,8 @@ int LibVirtDriver::deployment_description_kvm( // ------------------------------------------------------------------------ // Disks // ------------------------------------------------------------------------ + bool need_sata_controller = 0; + get_attribute(nullptr, host, cluster, "DISK", "DRIVER", default_driver); if (default_driver.empty()) @@ -1570,12 +1572,27 @@ int LibVirtDriver::deployment_description_kvm( if ( target_number >= 0 && target_number < 256 ) { - file << "\t\t\t
" << endl; + if ( sd_bus.compare((std::string)("sata")) == 0 ) + { + need_sata_controller = machine.find("q35"); + if (need_sata_controller) + file << "\t\t\t
" << endl; + else + file << "\t\t\t
" << endl; + } + + else + { + file << "\t\t\t
" << endl; + } } } file << "\t\t" << endl; + } // ------------------------------------------------------------------------ @@ -1669,6 +1686,9 @@ int LibVirtDriver::deployment_description_kvm( file << "/>" << endl << "\t\t" << endl; + if (need_sata_controller) + file << "\t\t" << endl; + // ------------------------------------------------------------------------ // Network interfaces // ------------------------------------------------------------------------