From 70c078aa2752a4889ea9bbd3e1b77456249194c1 Mon Sep 17 00:00:00 2001 From: Matt Gideon <117586514+Haibersut@users.noreply.github.com> Date: Mon, 20 Apr 2026 14:04:23 +0800 Subject: [PATCH] fix(host): fix isolated device detection regex for PCI and USB devices (#24690) --- pkg/hostman/isolated_device/gpu.go | 2 +- pkg/hostman/isolated_device/usb.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/hostman/isolated_device/gpu.go b/pkg/hostman/isolated_device/gpu.go index b703becb34..af84be1be3 100644 --- a/pkg/hostman/isolated_device/gpu.go +++ b/pkg/hostman/isolated_device/gpu.go @@ -55,7 +55,7 @@ var ( const ( BUSID_REGEX = `[0-9a-fA-F]{2}:[0-9a-fA-F]{2}\.[0-9a-fA-F]` CODE_REGEX = `[0-9a-fA-F]{4}` - LABEL_REGEX = `[\w+\ \.\,\:\+\&\-\/\[\]\(\)]+` + LABEL_REGEX = `[\w+\ \.\,\:\;\+\&\-\/\[\]\(\)]+` VFIO_PCI_KERNEL_DRIVER = "vfio-pci" DEFAULT_VGA_CMD = " -vga std" diff --git a/pkg/hostman/isolated_device/usb.go b/pkg/hostman/isolated_device/usb.go index d0753d1426..ac6c0d2971 100644 --- a/pkg/hostman/isolated_device/usb.go +++ b/pkg/hostman/isolated_device/usb.go @@ -381,9 +381,9 @@ const ( ) var ( - lsusbTreeRootBusRegex = `(?P(.*))Bus (?P([0-9]{2}))\.` - lsusbTreeBusSuffixRegex = `Port (?P([0-9]{1,2})): Dev (?P([0-9]{1,2})), Class=(?P(.*)), Driver=(?P(.*)),\s{0,1}(?P(.*))` - lsusbTreeSuffixRegex = `Port (?P([0-9]{1,2})): Dev (?P([0-9]{1,2})), If (?P([0-9]{1,2})), Class=(?P(.*)), Driver=(?P(.*)),\s{0,1}(?P(.*))` + lsusbTreeRootBusRegex = `(?P(.*))Bus (?P([0-9]{1,3}))\.` + lsusbTreeBusSuffixRegex = `Port (?P([0-9]{1,3})): Dev (?P([0-9]{1,3})), Class=(?P(.*)), Driver=(?P(.*)),\s{0,1}(?P(.*))` + lsusbTreeSuffixRegex = `Port (?P([0-9]{1,3})): Dev (?P([0-9]{1,3})), If (?P([0-9]{1,2})), Class=(?P(.*)), Driver=(?P(.*)),\s{0,1}(?P(.*))` lsusbTreeRootBusLineRegex = lsusbTreeRootBusRegex + lsusbTreeBusSuffixRegex lsusbTreeLineRegex = `(?P(.*))` + lsusbTreeSuffixRegex )