Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device: Don't require usb devices to have a serial #13428

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lxd/device/usb.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ func (d *usb) loadRawValues(p string) (map[string]string, error) {
for k := range values {
v, err := os.ReadFile(path.Join(p, k))
if err != nil {
// Not all devices have a serial file.
if k == "serial" && os.IsNotExist(err) {
continue
}

return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion lxd/fsmonitor/drivers/driver_fanotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (d *fanotify) getEvents(ctx context.Context, mountFd int) {
fd, err := unix.OpenByHandleAt(mountFd, fh, 0)
if err != nil {
errno := err.(unix.Errno)
if errno != unix.ESTALE {
if ctx.Err() == nil && errno != unix.ESTALE {
d.logger.Error("Failed to open file", logger.Ctx{"err": err})
}

Expand Down
Loading