mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
shares/resources/usbid: Only load the database once
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
parent
edbfefb528
commit
185a340466
@ -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"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user