mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-11 05:17:41 +03:00
Changes required to use addon-sheepdog
Just .h and .cc files to avoid users being forced to compile opennebula.
This commit is contained in:
parent
cc9d88f4db
commit
72faa33d2d
@ -82,6 +82,8 @@ public:
|
||||
RBD_CDROM = 4, /** < CEPH RBD CDROM disk */
|
||||
GLUSTER = 5, /** < Gluster Block Device */
|
||||
GLUSTER_CDROM = 6, /** < Gluster CDROM Device Device */
|
||||
SHEEPDOG = 7, /** < Sheepdog Block Device */
|
||||
SHEEPDOG_CDROM = 8, /** < Sheepdog CDROM Device Device */
|
||||
NONE = 255 /** < No disk type, error situation */
|
||||
};
|
||||
|
||||
@ -101,6 +103,8 @@ public:
|
||||
case RBD_CDROM: return "RBD_CDROM" ; break;
|
||||
case GLUSTER: return "GLUSTER" ; break;
|
||||
case GLUSTER_CDROM: return "GLUSTER_CDROM" ; break;
|
||||
case SHEEPDOG: return "SHEEPDOG" ; break;
|
||||
case SHEEPDOG_CDROM: return "SHEEPDOG_CDROM" ; break;
|
||||
default: return "";
|
||||
}
|
||||
};
|
||||
|
@ -335,6 +335,7 @@ int Datastore::insert(SqlDB *db, string& error_str)
|
||||
goto error_disk_type;
|
||||
break;
|
||||
case Image::RBD_CDROM:
|
||||
case Image::SHEEPDOG_CDROM:
|
||||
case Image::GLUSTER_CDROM:
|
||||
goto error_invalid_disk_type;
|
||||
break;
|
||||
|
@ -610,6 +610,10 @@ int Image::disk_attribute( VectorAttribute * disk,
|
||||
new_disk_type = RBD_CDROM;
|
||||
break;
|
||||
|
||||
case SHEEPDOG:
|
||||
new_disk_type = SHEEPDOG_CDROM;
|
||||
break;
|
||||
|
||||
case GLUSTER:
|
||||
new_disk_type = GLUSTER_CDROM;
|
||||
break;
|
||||
@ -784,6 +788,10 @@ Image::DiskType Image::str_to_disk_type(string& s_disk_type)
|
||||
{
|
||||
type = Image::RBD;
|
||||
}
|
||||
else if (s_disk_type == "SHEEPDOG")
|
||||
{
|
||||
type = Image::SHEEPDOG;
|
||||
}
|
||||
else if (s_disk_type == "GLUSTER")
|
||||
{
|
||||
type = Image::GLUSTER;
|
||||
|
@ -528,6 +528,26 @@ int LibVirtDriver::deployment_description_kvm(
|
||||
<< "\t\t\t</auth>" << endl;
|
||||
}
|
||||
}
|
||||
else if ( type == "SHEEPDOG" || type == "SHEEPDOG_CDROM" )
|
||||
{
|
||||
if (type == "SHEEPDOG")
|
||||
{
|
||||
file << "\t\t<disk type='network' device='disk'>" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
file << "\t\t<disk type='network' device='cdrom'>" << endl;
|
||||
}
|
||||
|
||||
file << "\t\t\t<source protocol='sheepdog' name='" << source;
|
||||
|
||||
if ( clone == "YES" )
|
||||
{
|
||||
file << "-" << vm->get_oid() << "-" << disk_id;
|
||||
}
|
||||
|
||||
file << "'/>" << endl;
|
||||
}
|
||||
else if ( type == "GLUSTER" || type == "GLUSTER_CDROM" )
|
||||
{
|
||||
if ( type == "GLUSTER" )
|
||||
|
Loading…
Reference in New Issue
Block a user