diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index aeb9caab2a1174706e1aa1a42a66c5a27eccdbda..699f2a0acbb493bab8fb6aac88eb9a6f2d916949 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -2914,8 +2914,14 @@ virNetDevRDMAFeature(const char *ifname, if (virAsprintf(ð_devpath, SYSFS_NET_DIR "%s/device/resource", ifname) < 0) goto cleanup; - if (!virFileExists(eth_devpath)) + + /* If /sys/class/net//device/resource doesn't exist it is not a PCI + * device and therefore it will not have RDMA. */ + if (!virFileExists(eth_devpath)) { + ret = 0; goto cleanup; + } + if (virFileReadAll(eth_devpath, RESOURCE_FILE_LEN, ð_res_buf) < 0) goto cleanup;