bug #2487: Always use the current system ds when resuming

(cherry picked from commit bc98a3fa02)

Conflicts:
	src/rm/RequestManagerVirtualMachine.cc
This commit is contained in:
Ruben S. Montero committed 2013-11-25 16:57:37 +01:00
1 parent 0203b7a3c5
commit 6a552f32fe
2 files changed
+36

No files matched your search

+10
View File
@@ -644,6 +644,16 @@ public:
return previous_history->reason;
};
/**
* Returns the action that closed the current history record. The hasHisto
* function MUST be called before this one.
* @return the action that closed the current history record
*/
const History::VMAction get_action() const
{
return history->action;
};
/**
* Returns the action that closed the history record in the previous host
* @return the action that closed the history record in the previous host
+26
View File
@@ -665,6 +665,32 @@ void VirtualMachineDeploy::request_execute(xmlrpc_c::paramList const& paramList,
return;
}
// ------------------------------------------------------------------------
// Authorize request
// ------------------------------------------------------------------------
auth = vm_authorization(id, 0, 0, att, &host_perms, 0, auth_op);
if (auth == false)
{
return;
}
if ((vm = get_vm(id, att)) == 0)
{
return;
}
if (vm->hasHistory() &&
(vm->get_action() == History::STOP_ACTION ||
vm->get_action() == History::UNDEPLOY_ACTION ||
vm->get_action() == History::UNDEPLOY_HARD_ACTION))
{
ds_id = vm->get_ds_id();
}
vm->unlock();
// ------------------------------------------------------------------------
// Get information about the system DS to use (tm_mad)
// ------------------------------------------------------------------------