mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Feature #1330: copy driver, dev_prefix and target to new images on save_as
(cherry picked from commit 8b0d9dd717fc67a6edd693308813682a5f5c42b6)
This commit is contained in:
parent
186e1d2e95
commit
4b3d6114a5
@ -561,6 +561,10 @@ void VirtualMachineSaveDisk::request_execute(xmlrpc_c::paramList const& paramLis
|
||||
int rc;
|
||||
string error_str;
|
||||
|
||||
string driver;
|
||||
string target;
|
||||
string dev_prefix;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Prepare and check the VM/DISK to be saved_as
|
||||
// -------------------------------------------------------------------------
|
||||
@ -607,6 +611,10 @@ void VirtualMachineSaveDisk::request_execute(xmlrpc_c::paramList const& paramLis
|
||||
|
||||
Image::ImageType type = img->get_type();
|
||||
|
||||
img->get_template_attribute("DRIVER", driver);
|
||||
img->get_template_attribute("TARGET", target);
|
||||
img->get_template_attribute("DEV_PREFIX", dev_prefix);
|
||||
|
||||
img->unlock();
|
||||
|
||||
if ((ds = dspool->get(ds_id, true)) == 0 )
|
||||
@ -652,6 +660,21 @@ void VirtualMachineSaveDisk::request_execute(xmlrpc_c::paramList const& paramLis
|
||||
itemplate->add("TYPE", img_type);
|
||||
}
|
||||
|
||||
if ( driver.empty() == false )
|
||||
{
|
||||
itemplate->add("DRIVER", driver);
|
||||
}
|
||||
|
||||
if ( target.empty() == false )
|
||||
{
|
||||
itemplate->add("TARGET", target);
|
||||
}
|
||||
|
||||
if ( dev_prefix.empty() == false )
|
||||
{
|
||||
itemplate->add("DEV_PREFIX", dev_prefix);
|
||||
}
|
||||
|
||||
itemplate->set_saving();
|
||||
|
||||
img_usage.add("SIZE", size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user