From 185a340466e6057b51d5636c01c2e0d0f376222e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Fri, 28 Nov 2025 00:46:24 -0500 Subject: [PATCH] shares/resources/usbid: Only load the database once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- shared/resources/usbid/load.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shared/resources/usbid/load.go b/shared/resources/usbid/load.go index 862c57e17a..67e55f4934 100644 --- a/shared/resources/usbid/load.go +++ b/shared/resources/usbid/load.go @@ -32,6 +32,11 @@ var ( // Load reads the USB database from disk. func Load() { + // Only load the database once. + if Vendors != nil && Classes != nil { + return + } + usbidFile := os.Getenv("INCUS_USBIDS_PATH") if usbidFile == "" { usbidFile = "/usr/share/misc/usb.ids"