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

Feature #1068: rbd names inside the name attribute of the disk's section in the libvirt domain file

This commit is contained in:
Jaime Melis 2013-02-14 18:53:49 +01:00
parent 20df320d7c
commit f52d7dbe34

View File

@ -56,6 +56,9 @@ int LibVirtDriver::deployment_description_kvm(
string ro = ""; string ro = "";
string driver = ""; string driver = "";
string cache = ""; string cache = "";
string source = "";
string clone = "";
int disk_id; int disk_id;
string default_driver = ""; string default_driver = "";
string default_driver_cache = ""; string default_driver_cache = "";
@ -305,7 +308,7 @@ int LibVirtDriver::deployment_description_kvm(
if ( disk == 0 ) if ( disk == 0 )
{ {
continue; continue;
} }
type = disk->vector_value("TYPE"); type = disk->vector_value("TYPE");
@ -313,6 +316,9 @@ int LibVirtDriver::deployment_description_kvm(
ro = disk->vector_value("READONLY"); ro = disk->vector_value("READONLY");
driver = disk->vector_value("DRIVER"); driver = disk->vector_value("DRIVER");
cache = disk->vector_value("CACHE"); cache = disk->vector_value("CACHE");
source = disk->vector_value("SOURCE");
clone = disk->vector_value("CLONE");
disk->vector_value_str("DISK_ID", disk_id); disk->vector_value_str("DISK_ID", disk_id);
if (target.empty()) if (target.empty())
@ -346,8 +352,14 @@ int LibVirtDriver::deployment_description_kvm(
{ {
file << "\t\t<disk type='network' device='disk'>" << endl file << "\t\t<disk type='network' device='disk'>" << endl
<< "\t\t\t<source protocol='rbd' name='" << "\t\t\t<source protocol='rbd' name='"
<< vm->get_remote_system_dir() << source;
<< "/disk." << disk_id << "'/>" << endl;
if ( clone == "YES" )
{
file << "-" << vm->get_oid() << "-" << disk_id;
}
file << "'/>" << endl;
} }
else if ( type == "CDROM" ) else if ( type == "CDROM" )
{ {