From dce9de481fde5919dca6f75074223af32b48bac1 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 6 Apr 2024 15:54:09 -0400 Subject: [PATCH] hostdev: Fix error when mdev type_id is missing Signed-off-by: Cole Robinson --- virtinst/devices/hostdev.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virtinst/devices/hostdev.py b/virtinst/devices/hostdev.py index cc10e5bf2..41f063279 100644 --- a/virtinst/devices/hostdev.py +++ b/virtinst/devices/hostdev.py @@ -70,8 +70,8 @@ class DeviceHostdev(Device): self.model = "vfio-ap" self.managed = "no" - elif (re.match("^nvidia-[0-9]{2}", nodedev.type_id) or - re.match("^i915-GVTg_V[0-9]_[0-9]", nodedev.type_id)): + elif (re.match("^nvidia-[0-9]{2}", nodedev.type_id or "") or + re.match("^i915-GVTg_V[0-9]_[0-9]", nodedev.type_id or "")): self.model = "vfio-pci" self.managed = "yes" self.display = "off"