1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

M #-: Log messages to VM log (#1339)

Bring back behaviour from one-5.12
This commit is contained in:
Pavel Czerný 2021-06-30 10:05:05 +02:00 committed by GitHub
parent 82faaeab4b
commit accdc228ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -292,7 +292,7 @@ private:
/**
*
*/
static void _log(std::unique_ptr<vm_msg_t> msg);
void _log(std::unique_ptr<vm_msg_t> msg);
/**
*

View File

@ -123,7 +123,7 @@ int VirtualMachineManager::start()
bind(&VirtualMachineManager::_resize, this, _1));
register_action(VMManagerMessages::LOG,
&VirtualMachineManager::_log);
bind(&VirtualMachineManager::_log, this, _1));
string error;
if ( DriverManager::start(error) != 0 )

View File

@ -858,7 +858,14 @@ void VirtualMachineManager::_resize(unique_ptr<vm_msg_t> msg)
void VirtualMachineManager::_log(unique_ptr<vm_msg_t> msg)
{
NebulaLog::log("VMM", log_type(msg->status()[0]), msg->payload());
if (msg->oid() < 0)
{
NebulaLog::log("VMM", log_type(msg->status()[0]), msg->payload());
}
else if (auto vm = vmpool->get_ro(msg->oid()))
{
vm->log("VMM", log_type(msg->status()[0]), msg->payload());
}
}
/* -------------------------------------------------------------------------- */