Comments (3)
Fixed in
pcidevices/pkg/controller/pcideviceclaim/pcideviceclaim_controller.go
Lines 87 to 103 in 3d85f9a
from pcidevices.
Please double check unbindDeviceFromDriver
func unbindDeviceFromDriver(addr string, driver string) error {
path := fmt.Sprintf("/sys/bus/pci/drivers/%s/unbind", driver)
file, err := os.OpenFile(path, os.O_WRONLY, 0400)
..
_, err = file.WriteString(addr)
if err != nil {
// file should be closed
return err ////
}
..
}
General practice in go is:
func unbindDeviceFromDriver(addr string, driver string) error {
...
file, err := os.OpenFile(path, os.O_WRONLY, 0400)
..
// after successfully OpenFile
defer file.Close() /// it will make sure, in any return path, file is closed
_, err = file.WriteString(addr)
// do NOT need any file.Close
...
..
}
from pcidevices.
Fixed in f10b170
from pcidevices.
Related Issues (16)
- [BUG] Remove dependence on `lspci` to enable distroless containers
- Question about reconcilePCIDeviceClaims HOT 5
- PDC controller is slow for user claim HOT 3
- [Bug] KubeVirt Allow-list doesn't always get refreshed HOT 2
- [BUG] PCIDeviceStatus.KernelModules is not being populated
- Race condition preventing PCIDeviceClaims from being deleted in some cases
- [BUG] Making a PCIDeviceClaim for a device in an IOMMU group can violate IOMMU restrictions, preventing successful allocation to a VM
- How to install pci controller? HOT 1
- Build failure HOT 2
- How to use it? HOT 2
- I find a bug about indexer??? HOT 3
- attemptToEnablePassthrough func return object conflict
- Introduce a separate `resourceName` property for KubeVirt device plugin names HOT 1
- gpu passthrough support? HOT 1
- How to install pcidevices into k8s using helm HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pcidevices.