guest: Add supports_virtioscsi()

This is similar to the existing supports_virtio*() functions,
but for virtio-scsi.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Andrea Bolognani 2019-03-04 17:11:14 +01:00 committed by Cole Robinson
parent 1a1875be06
commit c2bcb9e5a6
2 changed files with 8 additions and 0 deletions

View File

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

View File

@ -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",