@@ -18,7 +18,7 @@ package dpdkdrv
1818import (
1919 "bytes"
2020 "fmt"
21- "io/ioutil "
21+ "os "
2222 "path/filepath"
2323 "strconv"
2424 "strings"
@@ -114,7 +114,7 @@ func (dp *DevicePlugin) getDpdkDevice(vfBdf string) (string, error) {
114114 switch dp .dpdkDriver {
115115 case igbUio :
116116 uioDirPath := filepath .Join (dp .pciDeviceDir , vfBdf , uioSuffix )
117- files , err := ioutil .ReadDir (uioDirPath )
117+ files , err := os .ReadDir (uioDirPath )
118118 if err != nil {
119119 return "" , err
120120 }
@@ -189,7 +189,7 @@ func (dp *DevicePlugin) getDpdkMounts(dpdkDeviceName string) []pluginapi.Mount {
189189}
190190
191191func (dp * DevicePlugin ) getDeviceID (pciAddr string ) (string , error ) {
192- devID , err := ioutil .ReadFile (filepath .Join (dp .pciDeviceDir , filepath .Clean (pciAddr ), "device" ))
192+ devID , err := os .ReadFile (filepath .Join (dp .pciDeviceDir , filepath .Clean (pciAddr ), "device" ))
193193 if err != nil {
194194 return "" , errors .Wrapf (err , "Cannot obtain ID for the device %s" , pciAddr )
195195 }
@@ -202,7 +202,7 @@ func (dp *DevicePlugin) bindDevice(vfBdf string) error {
202202 unbindDevicePath := filepath .Join (dp .pciDeviceDir , vfBdf , driverUnbindSuffix )
203203
204204 // Unbind from the kernel driver
205- err := ioutil .WriteFile (unbindDevicePath , []byte (vfBdf ), 0600 )
205+ err := os .WriteFile (unbindDevicePath , []byte (vfBdf ), 0600 )
206206 if err != nil {
207207 return errors .Wrapf (err , "Unbinding from kernel driver failed for the device %s" , vfBdf )
208208 }
@@ -212,7 +212,7 @@ func (dp *DevicePlugin) bindDevice(vfBdf string) error {
212212 }
213213 bindDevicePath := filepath .Join (dp .pciDriverDir , dp .dpdkDriver , newIDSuffix )
214214 //Bind to the the dpdk driver
215- err = ioutil .WriteFile (bindDevicePath , []byte (vendorPrefix + vfdevID ), 0600 )
215+ err = os .WriteFile (bindDevicePath , []byte (vendorPrefix + vfdevID ), 0600 )
216216 if err != nil {
217217 return errors .Wrapf (err , "Binding to the DPDK driver failed for the device %s" , vfBdf )
218218 }
0 commit comments