| 189 | } |
| 190 | |
| 191 | static int |
| 192 | expand_pattern_to_node(struct graph *graph, const char *pattern) |
| 193 | { |
| 194 | struct node_head *node_head = node_list_head_get(); |
| 195 | bool found = false; |
| 196 | struct node *node; |
| 197 | |
| 198 | /* Check for pattern match */ |
| 199 | STAILQ_FOREACH(node, node_head, next) { |
| 200 | if (fnmatch(pattern, node->name, 0) == 0) { |
| 201 | if (graph_node_add(graph, node)) |
| 202 | goto fail; |
| 203 | found = true; |
| 204 | } |
| 205 | } |
| 206 | if (found == false) |
| 207 | SET_ERR_JMP(EFAULT, fail, "Pattern %s node not found", pattern); |
| 208 | |
| 209 | return 0; |
| 210 | fail: |
| 211 | return -rte_errno; |
| 212 | } |
| 213 | |
| 214 | static void |
| 215 | graph_cleanup(struct graph *graph) |
no test coverage detected