resource::HostImpl* NetZoneImpl::get_host_by_name_or_null(const std::string& name) const
{
+
+ auto host_it = hosts_.find(name);
+ if(host_it != hosts_.end())
+ return host_it->second;
+/*
for (auto const& [_, host] : hosts_) {
if (host->get_name() == name)
- return host;
- /* keep old behavior where host and VMs were saved together on EngineImpl::hosts_
- * get hosts returns VMs too */
+ return host;
+ / * keep old behavior where host and VMs were saved together on EngineImpl::hosts_
+ * get hosts returns VMs too * /
auto* vm = host->get_vm_by_name_or_null(name);
if (vm)
return vm;
}
+*/
for (const auto* child : children_) {
auto* host = child->get_host_by_name_or_null(name);