mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Feature #3737: Clear VM sched message when the VM is deployed
This commit is contained in:
parent
e8c90520d4
commit
410286fc17
@ -289,6 +289,13 @@ public:
|
||||
*/
|
||||
void log(const string &st);
|
||||
|
||||
/**
|
||||
* Clears the VM's USER_TEMPLATE/SCHED_MESSAGE attribute
|
||||
* @return true if the template was modified, false if SCHED_MESSAGE did not
|
||||
* need to be deleted
|
||||
*/
|
||||
bool clear_log();
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
|
@ -130,6 +130,13 @@ int VirtualMachinePoolXML::dispatch(int vid, int hid, int dsid, bool resched) co
|
||||
{
|
||||
xmlrpc_c::value deploy_result;
|
||||
|
||||
VirtualMachineXML* vm = get(vid);
|
||||
|
||||
if (vm != 0 && vm->clear_log())
|
||||
{
|
||||
update(vm);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (resched == true)
|
||||
|
@ -399,6 +399,30 @@ void VirtualMachineXML::log(const string &st)
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
bool VirtualMachineXML::clear_log()
|
||||
{
|
||||
string st;
|
||||
|
||||
if (user_template == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
user_template->get("SCHED_MESSAGE", st);
|
||||
|
||||
if (st.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
user_template->erase("SCHED_MESSAGE");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
int VirtualMachineXML::parse_action_name(string& action_st)
|
||||
{
|
||||
one_util::tolower(action_st);
|
||||
|
Loading…
x
Reference in New Issue
Block a user