diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index 19702dfee3..4e4a312a55 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -471,6 +471,18 @@ int VirtualMachine::insert(SqlDB * db, string& error_str) goto error_public; } + // ------------------------------------------------------------------------ + // Check for EMULATOR attribute + // ------------------------------------------------------------------------ + + user_obj_template->get("EMULATOR", value); + + if (!value.empty()) + { + user_obj_template->erase("EMULATOR"); + obj_template->add("EMULATOR", value); + } + // ------------------------------------------------------------------------ // Check for CPU, VCPU and MEMORY attributes // ------------------------------------------------------------------------ diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index 9a2c784a18..7f994b2171 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -379,11 +379,15 @@ int LibVirtDriver::deployment_description_kvm( // ------------------------------------------------------------------------ file << "\t" << endl; - get_default("EMULATOR",emulator_path); - + vm->get_template_attribute("EMULATOR", emulator_path); if(emulator_path.empty()) { - emulator_path = "/usr/bin/kvm"; + get_default("EMULATOR",emulator_path); + + if(emulator_path.empty()) + { + emulator_path = "/usr/bin/kvm"; + } } file << "\t\t" << one_util::escape_xml(emulator_path)