[virt-tools-list] [virt-manager PATCH 3/6] guest: Use virtio-scsi where supported

Andrea Bolognani abologna at redhat.com
Mon Mar 4 16:11:15 UTC 2019


Right now we're limiting use of virtio-scsi to ppc64/pseries
and aarch64/virt guests, but there's really no reason not to
use it wherever it's available.

This results in virtio-scsi being now used on s390x, where no
other sensible SCSI controller implementation is available
anyway, and x86, where you alreayd didn't want end up using
lsilogic.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 tests/cli-test-xml/compare/virt-install-many-devices.xml       | 1 +
 tests/cli-test-xml/compare/virt-install-s390x-cdrom-KVMIBM.xml | 1 +
 tests/cli-test-xml/compare/virt-install-s390x-cdrom.xml        | 1 +
 virtinst/guest.py                                              | 3 +--
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml b/tests/cli-test-xml/compare/virt-install-many-devices.xml
index b7386003..efd321e4 100644
--- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -184,6 +184,7 @@
       <master startport="4"/>
       <address type="pci" domain="0" bus="0" slot="4" function="2"/>
     </controller>
+    <controller type="scsi" index="0" model="virtio-scsi"/>
     <filesystem type="mount" accessmode="mapped">
       <source dir="/source"/>
       <target dir="/target"/>
diff --git a/tests/cli-test-xml/compare/virt-install-s390x-cdrom-KVMIBM.xml b/tests/cli-test-xml/compare/virt-install-s390x-cdrom-KVMIBM.xml
index 58a836c5..0941003c 100644
--- a/tests/cli-test-xml/compare/virt-install-s390x-cdrom-KVMIBM.xml
+++ b/tests/cli-test-xml/compare/virt-install-s390x-cdrom-KVMIBM.xml
@@ -28,6 +28,7 @@
       <target dev="sda" bus="scsi"/>
       <readonly/>
     </disk>
+    <controller type="scsi" index="0" model="virtio-scsi"/>
     <interface type="bridge">
       <source bridge="eth0"/>
       <mac address="00:11:22:33:44:55"/>
diff --git a/tests/cli-test-xml/compare/virt-install-s390x-cdrom.xml b/tests/cli-test-xml/compare/virt-install-s390x-cdrom.xml
index 10b0ddc1..7b23ed76 100644
--- a/tests/cli-test-xml/compare/virt-install-s390x-cdrom.xml
+++ b/tests/cli-test-xml/compare/virt-install-s390x-cdrom.xml
@@ -28,6 +28,7 @@
       <target dev="sda" bus="scsi"/>
       <readonly/>
     </disk>
+    <controller type="scsi" index="0" model="virtio-scsi"/>
     <interface type="bridge">
       <source bridge="eth0"/>
       <mac address="00:11:22:33:44:55"/>
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 4e7bcd41..1753d44d 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -801,8 +801,7 @@ class Guest(XMLBuilder):
                 has_any_scsi = True
 
         # Add virtio-scsi controller if needed
-        if ((self.os.is_arm_machvirt() or self.os.is_pseries()) and
-                not has_any_scsi):
+        if not has_any_scsi and self.supports_virtioscsi():
             for dev in self.devices.disk:
                 if dev.bus == "scsi":
                     ctrl = DeviceController(self.conn)
-- 
2.20.1




More information about the virt-tools-list mailing list