mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-26 10:03:37 +03:00
Changes required to use addon-sheepdog
Just .h and .cc files to avoid users being forced to compile opennebula. (cherry picked from commit 72faa33d2ddc186642aceb1845e9754aff7771c7) (cherry picked from commit 02e34cce7b9d58a54b36ec82f20f6da42e2f59d8)
This commit is contained in:
parent
c1afb55b6a
commit
7204dba0b0
@ -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;
|
||||
|
@ -537,6 +537,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…
x
Reference in New Issue
Block a user