Skip to content

Commit

Permalink
Merge pull request #13428 from tomponline/tp-usb
Browse files Browse the repository at this point in the history
Device: Don't require `usb` devices to have a `serial`
  • Loading branch information
tomponline authored May 3, 2024
2 parents ea3f443 + 575c826 commit b17dc08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit b17dc08

Please sign in to comment.