1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

B : Load vm_info from history records

This commit is contained in:
Ruben S. Montero 2017-07-18 13:44:58 +02:00
parent a87d049c02
commit 468a406097

View File

@ -343,6 +343,8 @@ string& History::to_xml(string& xml, bool database) const
int History::rebuild_attributes()
{
vector<xmlNodePtr> content;
int int_action;
int rc = 0;
@ -375,6 +377,26 @@ int History::rebuild_attributes()
action = static_cast<VMAction>(int_action);
// -------------------------------------------------------------------------
ObjectXML::get_nodes("/HISTORY/VM", content);
if (content.empty())
{
return -1;
}
ObjectXML vm_info_xml(content[0]);
ostringstream oss;
oss << vm_info_xml;
vm_info = oss.str();
ObjectXML::free_nodes(content);
content.clear();
non_persistent_data();
if (rc != 0)