From ef6216776e74a2889a8944ea25f1be4b4d245460 Mon Sep 17 00:00:00 2001 From: Archana Shinde Date: Wed, 19 Sep 2018 16:26:34 -0700 Subject: [PATCH] uevent: Add logs for uevents We should not receive many hotplug uevents. Log these so we can track what devices have been attached in the logs. Fixes #377 Signed-off-by: Archana Shinde --- agent.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agent.go b/agent.go index 088e096ec5..bc09b56f28 100644 --- a/agent.go +++ b/agent.go @@ -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 { @@ -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.