mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-26 06:50:09 +03:00
bug #1595: prevent double unlocks on relasing cloning images.
This commit is contained in:
parent
f20fb75852
commit
9311c5dc01
@ -430,7 +430,6 @@ int Image::from_xml(const string& xml)
|
||||
|
||||
ObjectXML::free_nodes(content);
|
||||
|
||||
|
||||
content.clear();
|
||||
|
||||
ObjectXML::get_nodes("/IMAGE/CLONES", content);
|
||||
|
@ -238,18 +238,20 @@ void ImageManager::release_cloning_image(int iid, int clone_img_id)
|
||||
return;
|
||||
}
|
||||
|
||||
int cloning = img->dec_cloning(clone_img_id);
|
||||
|
||||
switch (img->get_state())
|
||||
{
|
||||
case Image::USED:
|
||||
case Image::CLONE:
|
||||
|
||||
int cloning = img->dec_cloning(clone_img_id);
|
||||
|
||||
if ( cloning == 0 && img->get_running() == 0 )
|
||||
{
|
||||
img->set_state(Image::READY);
|
||||
}
|
||||
|
||||
ipool->update(img);
|
||||
|
||||
break;
|
||||
|
||||
case Image::DELETE:
|
||||
@ -266,11 +268,9 @@ void ImageManager::release_cloning_image(int iid, int clone_img_id)
|
||||
|
||||
NebulaLog::log("ImM", Log::ERROR, oss.str());
|
||||
|
||||
img->unlock();
|
||||
break;
|
||||
}
|
||||
|
||||
ipool->update(img);
|
||||
img->unlock();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user