From c2bcb9e5a60e40974963aef3099eff45c5eadcaf Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Mon, 4 Mar 2019 17:11:14 +0100 Subject: [PATCH] guest: Add supports_virtioscsi() This is similar to the existing supports_virtio*() functions, but for virtio-scsi. Signed-off-by: Andrea Bolognani --- virtinst/guest.py | 2 ++ virtinst/osdict.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/virtinst/guest.py b/virtinst/guest.py index 76414b4ca..134384223 100644 --- a/virtinst/guest.py +++ b/virtinst/guest.py @@ -413,6 +413,8 @@ class Guest(XMLBuilder): return self._supports_virtio(self.osinfo.supports_virtionet()) def supports_virtiodisk(self): return self._supports_virtio(self.osinfo.supports_virtiodisk()) + def supports_virtioscsi(self): + return self._supports_virtio(self.osinfo.supports_virtioscsi()) def _supports_virtioserial(self): return self._supports_virtio(self.osinfo.supports_virtioserial()) diff --git a/virtinst/osdict.py b/virtinst/osdict.py index a70824088..88d5ddc36 100644 --- a/virtinst/osdict.py +++ b/virtinst/osdict.py @@ -400,6 +400,12 @@ class _OsVariant(object): "http://pcisig.com/pci/1af4/1042"] return bool(self._device_filter(devids=devids)) + def supports_virtioscsi(self): + # virtio-scsi and virtio1.0-scsi + devids = ["http://pcisig.com/pci/1af4/1004", + "http://pcisig.com/pci/1af4/1048"] + return bool(self._device_filter(devids=devids)) + def supports_virtionet(self): # virtio-net and virtio1.0-net devids = ["http://pcisig.com/pci/1af4/1000",