mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
osdict: Pass down extra_devs to _device_filter()
Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
parent
afd3a98c1d
commit
35f6938c10
@ -518,42 +518,42 @@ class _OsVariant(object):
|
||||
return True
|
||||
|
||||
devids = ["http://usb.org/usb/80ee/0021"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
return bool(self._device_filter(devids=devids, extra_devs=extra_devs))
|
||||
|
||||
def supports_virtiodisk(self, extra_devs=None):
|
||||
# virtio-block and virtio1.0-block
|
||||
devids = ["http://pcisig.com/pci/1af4/1001",
|
||||
"http://pcisig.com/pci/1af4/1042"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
return bool(self._device_filter(devids=devids, extra_devs=extra_devs))
|
||||
|
||||
def supports_virtioscsi(self, extra_devs=None):
|
||||
# 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))
|
||||
return bool(self._device_filter(devids=devids, extra_devs=extra_devs))
|
||||
|
||||
def supports_virtionet(self, extra_devs=None):
|
||||
# virtio-net and virtio1.0-net
|
||||
devids = ["http://pcisig.com/pci/1af4/1000",
|
||||
"http://pcisig.com/pci/1af4/1041"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
return bool(self._device_filter(devids=devids, extra_devs=extra_devs))
|
||||
|
||||
def supports_virtiorng(self, extra_devs=None):
|
||||
# virtio-rng and virtio1.0-rng
|
||||
devids = ["http://pcisig.com/pci/1af4/1005",
|
||||
"http://pcisig.com/pci/1af4/1044"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
return bool(self._device_filter(devids=devids, extra_devs=extra_devs))
|
||||
|
||||
def supports_virtioballoon(self, extra_devs=None):
|
||||
# virtio-balloon and virtio1.0-balloon
|
||||
devids = ["http://pcisig.com/pci/1af4/1002",
|
||||
"http://pcisig.com/pci/1af4/1045"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
return bool(self._device_filter(devids=devids, extra_devs=extra_devs))
|
||||
|
||||
def supports_virtioserial(self, extra_devs=None):
|
||||
devids = ["http://pcisig.com/pci/1af4/1003",
|
||||
"http://pcisig.com/pci/1af4/1043"]
|
||||
if self._device_filter(devids=devids):
|
||||
if self._device_filter(devids=devids, extra_devs=extra_devs):
|
||||
return True
|
||||
# osinfo data was wrong for RHEL/centos here until Oct 2018
|
||||
# Remove this hack after 6 months or so
|
||||
@ -562,24 +562,24 @@ class _OsVariant(object):
|
||||
def supports_virtioinput(self, extra_devs=None):
|
||||
# virtio1.0-input
|
||||
devids = ["http://pcisig.com/pci/1af4/1052"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
return bool(self._device_filter(devids=devids, extra_devs=extra_devs))
|
||||
|
||||
def supports_usb3(self, extra_devs=None):
|
||||
# qemu-xhci
|
||||
devids = ["http://pcisig.com/pci/1b36/0004"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
return bool(self._device_filter(devids=devids, extra_devs=extra_devs))
|
||||
|
||||
def supports_virtio1(self, extra_devs=None):
|
||||
# Use virtio1.0-net device as a proxy for virtio1.0 as a whole
|
||||
devids = ["http://pcisig.com/pci/1af4/1041"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
return bool(self._device_filter(devids=devids, extra_devs=extra_devs))
|
||||
|
||||
def supports_chipset_q35(self, extra_devs=None):
|
||||
# For our purposes, check for the union of q35 + virtio1.0 support
|
||||
if self.supports_virtionet() and not self.supports_virtio1():
|
||||
return False
|
||||
devids = ["http://qemu.org/chipset/x86/q35"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
return bool(self._device_filter(devids=devids, extra_devs=extra_devs))
|
||||
|
||||
def get_recommended_resources(self):
|
||||
minimum = self._os and self._os.get_minimum_resources() or None
|
||||
|
Loading…
Reference in New Issue
Block a user