1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-24 21:34:01 +03:00

B #5255: handle BLOCK_CDROM disk types (#868)

Submitted by Anton Todorov <atodorov-storpool@users.noreply.github.com>

(cherry picked from commit 25eb83db77)
This commit is contained in:
Pavel Czerný 2021-02-24 12:19:29 +01:00 committed by Ruben S. Montero
parent c88ee63e86
commit 9d6a1334bd
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -987,15 +987,23 @@ int LibVirtDriver::deployment_description_kvm(
// ---- Disk type and source for the image ----
if ( type == "BLOCK" )
if ( type == "BLOCK" || type == "BLOCK_CDROM" )
{
ostringstream dev;
dev << vm->get_system_dir() << "/disk." << disk_id;
file << "\t\t<disk type='block' device='disk'>\n"
<< "\t\t\t<source dev=" << one_util::escape_xml_attr(dev.str())
<< "/>\n";
if (type == "BLOCK_CDROM")
{
file << "\t\t<disk type='block' device='cdrom'>" << endl;
}
else
{
file << "\t\t<disk type='block' device='disk'>" << endl;
}
file << "\t\t\t<source dev=" << one_util::escape_xml_attr(dev.str())
<< "/>" << endl;
}
else if ( type == "ISCSI" )
{