src/dpdk/drivers/bus/vmbus/linux/vmbus_bus.c
int
rte_vmbus_scan(void)
{
	struct dirent *e;
	DIR *dir;

	dir = opendir(SYSFS_VMBUS_DEVICES);
	if (dir == NULL) {
		if (errno == ENOENT)
			return 0;

		VMBUS_LOG(ERR, "opendir %s failed: %s",
			  SYSFS_VMBUS_DEVICES, strerror(errno));
		return -1;
	}

	while ((e = readdir(dir)) != NULL) {
		if (e->d_name[0] == '.')
			continue;

		if (vmbus_scan_one(e->d_name) < 0)
			goto error;
	}
	closedir(dir);
	return 0;

error:
	closedir(dir);
	return -1;
}
/*
 * Scan the content of the vmbus, and the devices in the devices list
 */
Scan the content of the vmbus, and the devices in the devices list
Scan the content of the vmbus and the devices in the devices list
int
rte_vmbus_scan(void)
{
	struct dirent *e;
	DIR *dir;
	dir = opendir(SYSFS_VMBUS_DEVICES);
	if (dir == NULL) {
		if (errno == ENOENT)
			return 0;
		VMBUS_LOG(ERR, "opendir %s failed: %s",
			  SYSFS_VMBUS_DEVICES, strerror(errno));
		return -1;
	}
	while ((e = readdir(dir)) != NULL) {
		if (e->d_name[0] == '.')
			continue;
		if (vmbus_scan_one(e->d_name) < 0)
			goto error;
	}
	closedir(dir);
	return 0;
error:
	closedir(dir);
	return -1;
}
int rte_vmbus_scan ( void ) { struct dirent * e ; DIR * dir ; dir = opendir ( SYSFS_VMBUS_DEVICES ) ; if ( dir == NULL ) { if ( errno == ENOENT ) return 0 ; VMBUS_LOG ( ERR , " " , SYSFS_VMBUS_DEVICES , strerror ( errno ) ) ; return -1 ; } while ( ( e = readdir ( dir ) ) != NULL ) { if ( e -> d_name [ 0 ] == ' ' ) continue ; if ( vmbus_scan_one ( e -> d_name ) < 0 ) goto error ; } closedir ( dir ) ; return 0 ; error : closedir ( dir ) ; return -1 ; }
Scan the content of the vmbus, and the devices in the devices list
Scan the content of the vmbus and the devices in the devices list