guest: remove useless has_virtio_scsi variable

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@redhat.com>
This commit is contained in:
Pavel Hrdina 2019-02-28 15:36:24 +01:00
parent a0b42327c6
commit 6f5762ab1f

View File

@ -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)