1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-21 13:57:56 +03:00

B #6140: Fix disk_type and source for block CD (#2591)

This commit is contained in:
Jan Orel 2023-04-25 12:34:53 +02:00 committed by GitHub
parent 30eb656e09
commit a5f15920f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1310,11 +1310,19 @@ int LibVirtDriver::deployment_description_kvm(
else if ( type == "CDROM" )
{
ostringstream cd_name;
string cd_type = "file";
string cd_source = "file";
cd_name << vm->get_system_dir() << "/disk." << disk_id;
file << "\t\t<disk type='file' device='cdrom'>\n"
<< "\t\t\t<source file="
if ( disk_type == "BLOCK" )
{
cd_type = "block";
cd_source = "dev";
}
file << "\t\t<disk type='" << cd_type << "' device='cdrom'>\n"
<< "\t\t\t<source " << cd_source << "="
<< one_util::escape_xml_attr(cd_name.str())<< "/>\n";
}
else