mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-25 06:03:36 +03:00
Bug #2252: Guest XML incorrect for CDROM images in a ceph datastore
Also prepare a new DiskType for Gluster, which might be useful in the future
This commit is contained in:
parent
3b2e92856e
commit
3c300cc5c3
@ -75,10 +75,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
enum DiskType
|
enum DiskType
|
||||||
{
|
{
|
||||||
FILE = 0, /** < File-based disk */
|
FILE = 0, /** < File-based disk */
|
||||||
CD_ROM = 1, /** < An ISO9660 disk */
|
CD_ROM = 1, /** < An ISO9660 disk */
|
||||||
BLOCK = 2, /** < Block-device disk */
|
BLOCK = 2, /** < Block-device disk */
|
||||||
RBD = 3 /** < CEPH RBD disk */
|
RBD = 3, /** < CEPH RBD disk */
|
||||||
|
RBD_CDROM = 4, /** < CEPH RBD CDROM disk */
|
||||||
|
GLUSTER = 5 /** < Gluster Block Device */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,11 +92,13 @@ public:
|
|||||||
{
|
{
|
||||||
switch (ob)
|
switch (ob)
|
||||||
{
|
{
|
||||||
case FILE: return "FILE" ; break;
|
case FILE: return "FILE" ; break;
|
||||||
case CD_ROM: return "CDROM" ; break;
|
case CD_ROM: return "CDROM" ; break;
|
||||||
case BLOCK: return "BLOCK" ; break;
|
case BLOCK: return "BLOCK" ; break;
|
||||||
case RBD: return "RBD" ; break;
|
case RBD: return "RBD" ; break;
|
||||||
default: return "";
|
case RBD_CDROM: return "RBD_CDROM" ; break;
|
||||||
|
case GLUSTER: return "GLUSTER" ; break;
|
||||||
|
default: return "";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -571,16 +571,27 @@ int Image::disk_attribute( VectorAttribute * disk,
|
|||||||
{
|
{
|
||||||
case OS:
|
case OS:
|
||||||
case DATABLOCK:
|
case DATABLOCK:
|
||||||
case RBD: //Type is FILE or BLOCK as inherited from the DS
|
|
||||||
disk_attr_type = disk_type_to_str(disk_type);
|
disk_attr_type = disk_type_to_str(disk_type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CDROM: //Always use CDROM type for these ones
|
case CDROM: //Always use CDROM type for these ones
|
||||||
disk_attr_type = "CDROM";
|
DiskType new_disk_type;
|
||||||
break;
|
|
||||||
|
switch(disk_type)
|
||||||
|
{
|
||||||
|
case RBD:
|
||||||
|
new_disk_type = RBD_CDROM;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
new_disk_type = CD_ROM;
|
||||||
|
}
|
||||||
|
|
||||||
|
disk_attr_type = disk_type_to_str(new_disk_type);
|
||||||
|
break;
|
||||||
|
|
||||||
default: //Other file types should not be never a DISK
|
default: //Other file types should not be never a DISK
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
disk->replace("TYPE", disk_attr_type);
|
disk->replace("TYPE", disk_attr_type);
|
||||||
|
@ -362,6 +362,19 @@ int LibVirtDriver::deployment_description_kvm(
|
|||||||
|
|
||||||
file << "'/>" << endl;
|
file << "'/>" << endl;
|
||||||
}
|
}
|
||||||
|
else if ( type == "RBD_CDROM" )
|
||||||
|
{
|
||||||
|
file << "\t\t<disk type='network' device='cdrom'>" << endl
|
||||||
|
<< "\t\t\t<source protocol='rbd' name='"
|
||||||
|
<< source;
|
||||||
|
|
||||||
|
if ( clone == "YES" )
|
||||||
|
{
|
||||||
|
file << "-" << vm->get_oid() << "-" << disk_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
file << "'/>" << endl;
|
||||||
|
}
|
||||||
else if ( type == "CDROM" )
|
else if ( type == "CDROM" )
|
||||||
{
|
{
|
||||||
file << "\t\t<disk type='file' device='cdrom'>" << endl
|
file << "\t\t<disk type='file' device='cdrom'>" << endl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user