Skip to content

Commit

Permalink
uevent: Add logs for uevents
Browse files Browse the repository at this point in the history
We should not receive many hotplug uevents. Log these so we can
track what devices have been attached in the logs.

Fixes kata-containers#377

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
  • Loading branch information
amshinde committed Sep 19, 2018
1 parent aa81883 commit ef62167
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ func (s *sandbox) listenToUdevEvents() {
}
defer uEvHandler.Close()

fieldLogger.Infof("Started listening for uevents")

for {
uEv, err := uEvHandler.Read()
if err != nil {
Expand All @@ -499,6 +501,8 @@ func (s *sandbox) listenToUdevEvents() {
"uevent-devname": uEv.DevName,
})

fieldLogger.Infof("Received add uevent")

// Check if device hotplug event results in a device node being created.
if uEv.DevName != "" && strings.HasPrefix(uEv.DevPath, rootBusPath) {
// Lock is needed to safey read and modify the pciDeviceMap and deviceWatchers.
Expand Down

0 comments on commit ef62167

Please sign in to comment.