1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

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

Submitted by Anton Todorov <atodorov-storpool@users.noreply.github.com>
This commit is contained in:
Pavel Czerný 2021-02-24 12:19:29 +01:00 committed by GitHub
parent 4e6b2d410c
commit 25eb83db77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -909,15 +909,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" )
{