mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
fix(usb_mass_storage): should use path instead of configPath
This commit is contained in:
@@ -128,6 +128,15 @@ func (u *UsbGadget) GetConfigPath(itemKey string) (string, error) {
|
||||
return joinPath(u.kvmGadgetPath, item.configPath), nil
|
||||
}
|
||||
|
||||
// GetPath returns the path to the item.
|
||||
func (u *UsbGadget) GetPath(itemKey string) (string, error) {
|
||||
item, ok := u.configMap[itemKey]
|
||||
if !ok {
|
||||
return "", fmt.Errorf("config item %s not found", itemKey)
|
||||
}
|
||||
return joinPath(u.kvmGadgetPath, item.path), nil
|
||||
}
|
||||
|
||||
func mountConfigFS() error {
|
||||
_, err := os.Stat(gadgetPath)
|
||||
// TODO: check if it's mounted properly
|
||||
|
||||
Reference in New Issue
Block a user