Skip to content

Commit e27caf5

Browse files
committed
test disable device path
1 parent 0e7a44f commit e27caf5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/deviceutils/device-utils_linux.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ import (
2020
"fmt"
2121
"os"
2222
"path/filepath"
23+
24+
"k8s.io/klog/v2"
2325
)
2426

2527
func (_ *deviceUtils) DisableDevice(devicePath string) error {
2628
deviceName := filepath.Base(devicePath)
27-
return os.WriteFile(fmt.Sprintf("/sys/block/%s/device/state", deviceName), []byte("offline"), 0644)
29+
f := fmt.Sprintf("/sys/block/%s/device/state", deviceName)
30+
klog.Infof("DisableDevice called with device path %s device name %s, target filepath %s", devicePath, deviceName, f)
31+
return os.WriteFile(f, []byte("offline"), 0644)
2832
}

0 commit comments

Comments
 (0)