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

Bring back behaviour from one-5.12

(cherry picked from commit accdc228ca)
This commit is contained in:
Pavel Czerný authored and Ruben S. Montero committed 2021-06-30 10:11:13 +02:00
1 parent 13166e9981
commit 9125340934
3 files changed
+10 -3

No files matched your search

+1 -1
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);
/**
*
+1 -1
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 )
+8 -1
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());
}
}
/* -------------------------------------------------------------------------- */