mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-31 01:47:11 +03:00
F #3053: Add support for virtio-scsi controller
This commit is contained in:
parent
6b0814ef78
commit
93f078d173
@ -203,19 +203,23 @@ int LibVirtDriver::deployment_description_kvm(
|
||||
|
||||
const VectorAttribute * features;
|
||||
|
||||
bool pae = false;
|
||||
bool acpi = false;
|
||||
bool apic = false;
|
||||
bool hyperv = false;
|
||||
bool localtime = false;
|
||||
bool guest_agent = false;
|
||||
bool pae = false;
|
||||
bool acpi = false;
|
||||
bool apic = false;
|
||||
bool hyperv = false;
|
||||
bool localtime = false;
|
||||
bool guest_agent = false;
|
||||
bool virtio_scsi = false;
|
||||
int virtio_scsi_queues = 0;
|
||||
|
||||
int pae_found = -1;
|
||||
int acpi_found = -1;
|
||||
int apic_found = -1;
|
||||
int hyperv_found = -1;
|
||||
int localtime_found = -1;
|
||||
int guest_agent_found = -1;
|
||||
int pae_found = -1;
|
||||
int acpi_found = -1;
|
||||
int apic_found = -1;
|
||||
int hyperv_found = -1;
|
||||
int localtime_found = -1;
|
||||
int guest_agent_found = -1;
|
||||
int virtio_scsi_found = -1;
|
||||
int virtio_scsi_queues_found = -1;
|
||||
|
||||
string hyperv_options = "";
|
||||
|
||||
@ -1148,6 +1152,7 @@ int LibVirtDriver::deployment_description_kvm(
|
||||
hyperv_found = features->vector_value("HYPERV", hyperv);
|
||||
localtime_found = features->vector_value("LOCALTIME", localtime);
|
||||
guest_agent_found = features->vector_value("GUEST_AGENT", guest_agent);
|
||||
virtio_scsi_found = features->vector_value("VIRTIO_SCSI", virtio_scsi);
|
||||
}
|
||||
|
||||
if ( pae_found != 0 )
|
||||
@ -1180,6 +1185,11 @@ int LibVirtDriver::deployment_description_kvm(
|
||||
get_default("FEATURES", "GUEST_AGENT", guest_agent);
|
||||
}
|
||||
|
||||
if ( virtio_scsi_found != 0 )
|
||||
{
|
||||
get_default("FEATURES", "VIRTIO_SCSI", virtio_scsi);
|
||||
}
|
||||
|
||||
if ( acpi || pae || apic || hyperv )
|
||||
{
|
||||
file << "\t<features>" << endl;
|
||||
@ -1226,6 +1236,30 @@ int LibVirtDriver::deployment_description_kvm(
|
||||
<< "\t</devices>" << endl;
|
||||
}
|
||||
|
||||
if ( virtio_scsi )
|
||||
{
|
||||
virtio_scsi_queues_found = features->vector_value(
|
||||
"VIRTIO_SCSI_QUEUES", virtio_scsi_queues);
|
||||
|
||||
if ( virtio_scsi_queues_found != 0 )
|
||||
{
|
||||
get_default("FEATURES", "VIRTIO_SCSI_QUEUES", virtio_scsi_queues);
|
||||
}
|
||||
|
||||
file << "\t<devices>" << endl
|
||||
<< "\t\t<controller type='scsi' index='0' model='virtio-scsi'>"
|
||||
<< endl;
|
||||
|
||||
if ( virtio_scsi_queues > 0 )
|
||||
{
|
||||
file << "\t\t\t<driver queues='" << virtio_scsi_queues << "'/>"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
file << "\t\t</controller>" << endl
|
||||
<< "\t</devices>" << endl;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Raw KVM attributes
|
||||
// ------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user