| 45 | } |
| 46 | |
| 47 | void |
| 48 | cmd_attach_parsed(void *parsed_result, |
| 49 | struct cmdline *cl, |
| 50 | __rte_unused void *data) |
| 51 | { |
| 52 | struct cmd_attach_result *res = parsed_result; |
| 53 | struct rte_devargs da; |
| 54 | |
| 55 | memset(&da, 0, sizeof(da)); |
| 56 | |
| 57 | if (rte_devargs_parsef(&da, "%s", res->devargs)) { |
| 58 | cmdline_printf(cl, "cannot parse devargs\n"); |
| 59 | return; |
| 60 | } |
| 61 | |
| 62 | if (!rte_eal_hotplug_add(rte_bus_name(da.bus), da.name, da.args)) |
| 63 | cmdline_printf(cl, "attached device %s\n", da.name); |
| 64 | else |
| 65 | cmdline_printf(cl, "failed to attached device %s\n", |
| 66 | da.name); |
| 67 | rte_devargs_reset(&da); |
| 68 | } |
| 69 | |
| 70 | void |
| 71 | cmd_detach_parsed(void *parsed_result, |
nothing calls this directly
no test coverage detected