F #3053: add explicit address to scsi drives

By default scsi drives increase the unit part of the address. This
causes problems in linux as the devices are not created in order.

Setting the target forces the order to be maintained.

https://bugzilla.redhat.com/show_bug.cgi?id=1200049
This commit is contained in:
Javi Fontan committed 2017-05-17 15:24:57 +02:00
1 parent 05511e5c59
commit e164fde85f
1 file changed
+13
+13
View File
@@ -801,6 +801,19 @@ int LibVirtDriver::deployment_description_kvm(
file << "\t\t\t</iotune>" << endl;
}
// ---- SCSI target ----
if ( target[0] == 's' && target[1] == 'd' )
{
int target_number = target[2] - 'a';
if ( target_number >= 0 && target_number < 256 )
{
file << "\t\t\t<address type='drive' controller='0' bus='0' " <<
"target='" << target_number << "' unit='0'/>" << endl;
}
}
file << "\t\t</disk>" << endl;
}