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ý authored and GitHub committed 2021-02-24 12:19:29 +01:00
1 parent 4e6b2d410c
commit 25eb83db77
1 file changed
+12 -4
+12 -4
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" )
{