From ed7c16813e7b07ca4f8478a03bd6eb9907296a5a Mon Sep 17 00:00:00 2001 From: Jan Orel Date: Tue, 17 Sep 2019 16:26:59 +0200 Subject: [PATCH] B #2971: scsi-virtio controller for scsi disks (#3709) Since ONE numbers scsi devices solely using target attribute it's required to use virtio-scsi controller when more than one scsi disk is used. --- src/vmm/LibVirtDriverKVM.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index b49be083d8..83a3fa3af5 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -529,6 +529,7 @@ int LibVirtDriver::deployment_description_kvm( bool localtime = false; bool guest_agent = false; int virtio_scsi_queues = 0; + int scsi_targets_num = 0; int pae_found = -1; int acpi_found = -1; @@ -1255,6 +1256,7 @@ int LibVirtDriver::deployment_description_kvm( { file << "\t\t\t
" << endl; + scsi_targets_num++; } } @@ -1733,13 +1735,16 @@ int LibVirtDriver::deployment_description_kvm( << "\t" << endl; } - if ( virtio_scsi_queues > 0 ) + if ( virtio_scsi_queues > 0 || scsi_targets_num > 1) { file << "\t" << endl << "\t\t" << endl; - file << "\t\t\t" << endl; + if ( virtio_scsi_queues > 0 ) + { + file << "\t\t\t" << endl; + } file << "\t\t" << endl << "\t" << endl; @@ -1778,7 +1783,7 @@ int LibVirtDriver::deployment_description_kvm( << "\t\t\t" << one_util::escape_xml(vm->get_system_dir()) << "\n" - << "" + << "\t\t\t" << one_util::escape_xml(vm->get_name()) << "\n" << "\t\t\t"