| 38 | #define PREFIX_ALLOW "--allow=" |
| 39 | |
| 40 | static int |
| 41 | add_parameter_allow(char **argv, int max_capacity) |
| 42 | { |
| 43 | struct rte_devargs *devargs; |
| 44 | int count = 0; |
| 45 | |
| 46 | RTE_EAL_DEVARGS_FOREACH(NULL, devargs) { |
| 47 | if (strlen(devargs->name) == 0) |
| 48 | continue; |
| 49 | |
| 50 | if (devargs->data == NULL || strlen(devargs->data) == 0) { |
| 51 | if (asprintf(&argv[count], PREFIX_ALLOW"%s", devargs->name) < 0) |
| 52 | break; |
| 53 | } else { |
| 54 | if (asprintf(&argv[count], PREFIX_ALLOW"%s,%s", |
| 55 | devargs->name, devargs->data) < 0) |
| 56 | break; |
| 57 | } |
| 58 | |
| 59 | if (++count == max_capacity) |
| 60 | break; |
| 61 | } |
| 62 | |
| 63 | return count; |
| 64 | } |
| 65 | |
| 66 | /* |
| 67 | * launches a second copy of the test process using the given argv parameters, |