diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c index 84f36159c8..0952767000 100644 --- a/src/qemu/qemu_hostdev.c +++ b/src/qemu/qemu_hostdev.c @@ -115,10 +115,6 @@ qemuHostdevHostSupportsPassthroughVFIO(void) goto cleanup; while ((direrr = virDirRead(iommuDir, &iommuGroup, NULL)) > 0) { - /* skip ./ ../ */ - if (STRPREFIX(iommuGroup->d_name, ".")) - continue; - /* assume we found a group */ break; } diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c index b08d96096d..d05f013cee 100644 --- a/src/storage/storage_backend_scsi.c +++ b/src/storage/storage_backend_scsi.c @@ -273,9 +273,6 @@ getNewStyleBlockDevice(const char *lun_path, } while ((direrr = virDirRead(block_dir, &block_dirent, block_path)) > 0) { - if (STREQLEN(block_dirent->d_name, ".", 1)) - continue; - if (VIR_STRDUP(*block_device, block_dirent->d_name) < 0) goto cleanup; diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 1fd46cc85a..e91f5f6d4d 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -3392,7 +3392,6 @@ virCgroupRemoveRecursively(char *grppath) while ((direrr = virDirRead(grpdir, &ent, NULL)) > 0) { char *path; - if (ent->d_name[0] == '.') continue; if (ent->d_type != DT_DIR) continue; if (virAsprintf(&path, "%s/%s", grppath, ent->d_name) == -1) { diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 75ec484a4a..2a5fe159b6 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -3172,8 +3172,6 @@ virNetDevRDMAFeature(const char *ifname, goto cleanup; while (virDirRead(dirp, &dp, SYSFS_INFINIBAND_DIR) > 0) { - if (dp->d_name[0] == '.') - continue; if (virAsprintf(&ib_devpath, SYSFS_INFINIBAND_DIR "%s/device/resource", dp->d_name) < 0) continue; diff --git a/src/util/virpci.c b/src/util/virpci.c index 307892bddb..7273327b3c 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -471,10 +471,6 @@ virPCIDeviceIterDevices(virPCIDeviceIterPredicate predicate, virPCIDevicePtr check; char *tmp; - /* Ignore '.' and '..' */ - if (entry->d_name[0] == '.') - continue; - /* expected format: ::. */ if (/* domain */ virStrToLong_ui(entry->d_name, &tmp, 16, &domain) < 0 || *tmp != ':' || @@ -2030,9 +2026,6 @@ virPCIDeviceAddressIOMMUGroupIterate(virPCIDeviceAddressPtr orig, while ((direrr = virDirRead(groupDir, &ent, groupPath)) > 0) { virPCIDeviceAddress newDev; - if (ent->d_name[0] == '.') - continue; - if (virPCIDeviceAddressParse(ent->d_name, &newDev) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Found invalid device link '%s' in '%s'"), diff --git a/src/util/virprocess.c b/src/util/virprocess.c index b0ca1ce38a..5541a4f1cc 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -619,10 +619,6 @@ int virProcessGetPids(pid_t pid, size_t *npids, pid_t **pids) long long tmp; pid_t tmp_pid; - /* Skip . and .. */ - if (STRPREFIX(ent->d_name, ".")) - continue; - if (virStrToLong_ll(ent->d_name, NULL, 10, &tmp) < 0) goto cleanup; tmp_pid = tmp; diff --git a/src/util/virscsi.c b/src/util/virscsi.c index 72a56614a3..ec5e017883 100644 --- a/src/util/virscsi.c +++ b/src/util/virscsi.c @@ -134,9 +134,6 @@ virSCSIDeviceGetSgName(const char *sysfs_prefix, } while (virDirRead(dir, &entry, path) > 0) { - if (entry->d_name[0] == '.') - continue; - /* Assume a single directory entry */ ignore_value(VIR_STRDUP(sg, entry->d_name)); break; @@ -180,9 +177,6 @@ virSCSIDeviceGetDevName(const char *sysfs_prefix, } while (virDirRead(dir, &entry, path) > 0) { - if (entry->d_name[0] == '.') - continue; - ignore_value(VIR_STRDUP(name, entry->d_name)); break; } diff --git a/src/util/virusb.c b/src/util/virusb.c index 33b188e624..5a95dcb5a1 100644 --- a/src/util/virusb.c +++ b/src/util/virusb.c @@ -150,7 +150,7 @@ virUSBDeviceSearch(unsigned int vendor, unsigned int found_prod, found_vend, found_bus, found_devno; char *tmpstr = de->d_name; - if (de->d_name[0] == '.' || strchr(de->d_name, ':')) + if (strchr(de->d_name, ':')) continue; if (virUSBSysReadFile("idVendor", de->d_name, diff --git a/src/util/virutil.c b/src/util/virutil.c index a6c1273fd2..1bd7db82ce 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -1868,7 +1868,7 @@ virFindSCSIHostByPCI(const char *sysfs_prefix, } while (virDirRead(dir, &entry, prefix) > 0) { - if (entry->d_name[0] == '.' || !virFileIsLink(entry->d_name)) + if (!virFileIsLink(entry->d_name)) continue; if (virAsprintf(&host_link, "%s/%s", prefix, entry->d_name) < 0) @@ -2218,9 +2218,6 @@ virGetFCHostNameByWWN(const char *sysfs_prefix, } while (0) while (virDirRead(dir, &entry, prefix) > 0) { - if (entry->d_name[0] == '.') - continue; - if (virAsprintf(&wwnn_path, "%s/%s/node_name", prefix, entry->d_name) < 0) goto cleanup; @@ -2303,9 +2300,6 @@ virFindFCHostCapableVport(const char *sysfs_prefix) unsigned int host; char *p = NULL; - if (entry->d_name[0] == '.') - continue; - p = entry->d_name + strlen("host"); if (virStrToLong_ui(p, NULL, 10, &host) == -1) { VIR_DEBUG("Failed to parse host number from '%s'",