[virt-tools-list] [virt-manager PATCH] guest: remove useless has_virtio_scsi variable

Pavel Hrdina phrdina at redhat.com
Thu Feb 28 14:47:16 UTC 2019


Apart from the fact, that 'virtio' is not a valid scsi controller model
the 'has_virtio_scsi' variable is not needed at all.  It is used only
in one condition where both 'has_any_scsi' and 'has_virtio_scsi' has to
be false which can happen only if there is no 'scsi' controller defined
by user.

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---

Pushed

 virtinst/guest.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/virtinst/guest.py b/virtinst/guest.py
index 13b88cf2..6e05b5b5 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -794,15 +794,12 @@ class Guest(XMLBuilder):
 
     def _add_implied_controllers(self):
         has_spapr_scsi = False
-        has_virtio_scsi = False
         has_any_scsi = False
         for dev in self.devices.controller:
             if dev.type == "scsi":
                 has_any_scsi = True
                 if dev.address.type == "spapr-vio":
                     has_spapr_scsi = True
-                if dev.model == "virtio":
-                    has_virtio_scsi = True
 
         # Add spapr-vio controller if needed
         if not has_spapr_scsi:
@@ -817,8 +814,7 @@ class Guest(XMLBuilder):
 
         # Add virtio-scsi controller if needed
         if ((self.os.is_arm_machvirt() or self.os.is_pseries()) and
-            not has_any_scsi and
-            not has_virtio_scsi):
+                not has_any_scsi):
             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