| 68 | } |
| 69 | |
| 70 | void |
| 71 | cmd_detach_parsed(void *parsed_result, |
| 72 | struct cmdline *cl, |
| 73 | __rte_unused void *data) |
| 74 | { |
| 75 | struct cmd_detach_result *res = parsed_result; |
| 76 | struct rte_devargs da; |
| 77 | |
| 78 | memset(&da, 0, sizeof(da)); |
| 79 | |
| 80 | if (rte_devargs_parsef(&da, "%s", res->devargs)) { |
| 81 | cmdline_printf(cl, "cannot parse devargs\n"); |
| 82 | return; |
| 83 | } |
| 84 | |
| 85 | printf("detaching...\n"); |
| 86 | if (!rte_eal_hotplug_remove(rte_bus_name(da.bus), da.name)) |
| 87 | cmdline_printf(cl, "detached device %s\n", |
| 88 | da.name); |
| 89 | else |
| 90 | cmdline_printf(cl, "failed to detach device %s\n", |
| 91 | da.name); |
| 92 | rte_devargs_reset(&da); |
| 93 | } |
nothing calls this directly
no test coverage detected