diff --git a/agent.go b/agent.go index 031600296..4c0ff340b 100644 --- a/agent.go +++ b/agent.go @@ -774,34 +774,14 @@ func (s *sandbox) listenToUdevEvents() { fieldLogger.Infof("Got a wait channel for device %s", devAddress) - // blk driver case - if strings.HasPrefix(uEv.DevPath, filepath.Join(rootBusPath, devAddress)) { - goto OUT - } - - // pmem/nvdimm case - if strings.Contains(uEv.DevPath, pfnDevPrefix) && strings.HasSuffix(uEv.DevPath, devAddress) { - goto OUT - } - + // This is a pretty imperfect way of + // matching, but it's the same as we + // use in getDeviceName() if strings.Contains(uEv.DevPath, devAddress) { - // scsi driver case - if strings.HasSuffix(devAddress, scsiBlockSuffix) { - goto OUT - } - // blk-ccw driver case - if strings.HasSuffix(devAddress, blkCCWSuffix) { - goto OUT - } + ch <- uEv.DevName + close(ch) + delete(s.deviceWatchers, devAddress) } - - continue - - OUT: - ch <- uEv.DevName - close(ch) - delete(s.deviceWatchers, devAddress) - } s.Unlock() diff --git a/device_amd64.go b/device_amd64.go index 66bc0522a..fe9f8b785 100644 --- a/device_amd64.go +++ b/device_amd64.go @@ -16,8 +16,4 @@ const ( // processors, thermal zones. Those objects are exported to user space via // sysfs as directories in the subtree under /sys/devices/LNXSYSTM:00 acpiDevPath = "/devices/LNXSYSTM" - - // /dev/pmemX devices exported in the ACPI sysfs (/devices/LNXSYSTM) are - // in a subdirectory whose prefix is pfn (page frame number). - pfnDevPrefix = "/pfn" ) diff --git a/device_arm64.go b/device_arm64.go index b73b582d4..11c4e70d8 100644 --- a/device_arm64.go +++ b/device_arm64.go @@ -15,8 +15,4 @@ const ( // processors, thermal zones. Those objects are exported to user space via // sysfs as directories in the subtree under /sys/devices/LNXSYSTM:00 acpiDevPath = "/devices/LNXSYSTM" - - // /dev/pmemX devices exported in the ACPI sysfs (/devices/LNXSYSTM) are - // in a subdirectory whose prefix is pfn (page frame number). - pfnDevPrefix = "/pfn" ) diff --git a/device_ppc64le.go b/device_ppc64le.go index 66bc0522a..fe9f8b785 100644 --- a/device_ppc64le.go +++ b/device_ppc64le.go @@ -16,8 +16,4 @@ const ( // processors, thermal zones. Those objects are exported to user space via // sysfs as directories in the subtree under /sys/devices/LNXSYSTM:00 acpiDevPath = "/devices/LNXSYSTM" - - // /dev/pmemX devices exported in the ACPI sysfs (/devices/LNXSYSTM) are - // in a subdirectory whose prefix is pfn (page frame number). - pfnDevPrefix = "/pfn" ) diff --git a/device_s390x.go b/device_s390x.go index dd8cecab5..e28074c44 100644 --- a/device_s390x.go +++ b/device_s390x.go @@ -16,8 +16,4 @@ const ( // processors, thermal zones. Those objects are exported to user space via // sysfs as directories in the subtree under /sys/devices/LNXSYSTM:00 acpiDevPath = "/devices/LNXSYSTM" - - // /dev/pmemX devices exported in the ACPI sysfs (/devices/LNXSYSTM) are - // in a subdirectory whose prefix is pfn (page frame number). - pfnDevPrefix = "/pfn" )