mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-11 05:17:41 +03:00
Feature #4400: Fix missing DISK/SOURCE
This commit is contained in:
parent
53c5269249
commit
191eda35d3
@ -1638,7 +1638,7 @@ public:
|
||||
/**
|
||||
* Clears the flag for the disks waiting for the given image
|
||||
*/
|
||||
void clear_cloning_image_id(int image_id);
|
||||
void clear_cloning_image_id(int image_id, string source);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -2095,7 +2095,9 @@ void LifeCycleManager::disk_lock_success(int vid)
|
||||
|
||||
vm->unlock();
|
||||
|
||||
set<int> ready;
|
||||
vector< pair<int,string> > ready;
|
||||
vector< pair<int,string> >::iterator rit;
|
||||
|
||||
set<int> error;
|
||||
|
||||
for (set<int>::iterator id = ids.begin(); id != ids.end(); id++)
|
||||
@ -2107,7 +2109,7 @@ void LifeCycleManager::disk_lock_success(int vid)
|
||||
switch (image->get_state()) {
|
||||
case Image::USED:
|
||||
case Image::USED_PERS:
|
||||
ready.insert(*id);
|
||||
ready.push_back( make_pair(*id, image->get_source()) );
|
||||
break;
|
||||
|
||||
case Image::ERROR:
|
||||
@ -2136,9 +2138,9 @@ void LifeCycleManager::disk_lock_success(int vid)
|
||||
return;
|
||||
}
|
||||
|
||||
for (set<int>::iterator id = ready.begin(); id != ready.end(); id++)
|
||||
for (rit = ready.begin(); rit != ready.end(); rit++)
|
||||
{
|
||||
vm->clear_cloning_image_id(*id);
|
||||
vm->clear_cloning_image_id(rit->first, rit->second);
|
||||
}
|
||||
|
||||
if (ids.size() == ready.size())
|
||||
|
@ -2147,7 +2147,7 @@ set<int> VirtualMachine::get_cloning_image_ids()
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
void VirtualMachine::clear_cloning_image_id(int image_id)
|
||||
void VirtualMachine::clear_cloning_image_id(int image_id, string source)
|
||||
{
|
||||
bool cloning;
|
||||
int disk_image_id;
|
||||
@ -2165,9 +2165,10 @@ void VirtualMachine::clear_cloning_image_id(int image_id)
|
||||
disk_image_id == image_id)
|
||||
{
|
||||
disks[i]->remove("CLONING");
|
||||
|
||||
disks[i]->replace("SOURCE", source);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user