diff --git a/src/cli/cli.h b/src/cli/cli.h index f9c35f10..1be42bb3 100644 --- a/src/cli/cli.h +++ b/src/cli/cli.h @@ -55,6 +55,7 @@ struct context { char *mig_config; char *mig_monitor; char *imex_channels; + char *driver_opts; }; bool matches_pci_format(const char *gpu, char *buf, size_t bufsize); diff --git a/src/cli/configure.c b/src/cli/configure.c index 8890b4ea..eadbacd7 100644 --- a/src/cli/configure.c +++ b/src/cli/configure.c @@ -33,6 +33,8 @@ const struct argp configure_usage = { {"imex-channel", 0x83, "CHANNEL", 0, "IMEX channel ID(s) to inject", -1}, {"no-cgroups", 0x84, NULL, 0, "Don't use cgroup enforcement", -1}, {"no-devbind", 0x85, NULL, 0, "Don't bind mount devices", -1}, + {"no-persistenced", 0x86, NULL, 0, "Don't include the NVIDIA persistenced socket", -1}, + {"no-fabricmanager", 0x87, NULL, 0, "Don't include the NVIDIA fabricmanager socket", -1}, {0}, }, configure_parser, @@ -150,6 +152,14 @@ configure_parser(int key, char *arg, struct argp_state *state) if (str_join(&err, &ctx->container_flags, "no-devbind", " ") < 0) goto fatal; break; + case 0x86: + if (str_join(&err, &ctx->driver_opts, "no-persistenced", " ") < 0) + goto fatal; + break; + case 0x87: + if (str_join(&err, &ctx->driver_opts, "no-fabricmanager", " ") < 0) + goto fatal; + break; case ARGP_KEY_ARG: if (state->arg_num > 0) argp_usage(state); @@ -290,7 +300,7 @@ configure_command(const struct context *ctx) warnx("permission error: %s", err.msg); goto fail; } - if ((drv = libnvc.driver_info_new(nvc, NULL)) == NULL || + if ((drv = libnvc.driver_info_new(nvc, ctx->driver_opts)) == NULL || (dev = libnvc.device_info_new(nvc, NULL)) == NULL) { warnx("detection error: %s", libnvc.error(nvc)); goto fail; diff --git a/src/cli/list.c b/src/cli/list.c index 8574a0c9..24ccddfe 100644 --- a/src/cli/list.c +++ b/src/cli/list.c @@ -22,6 +22,8 @@ const struct argp list_usage = { {"mig-config", 0x81, "ID", 0, "MIG devices to list config capabilities files for", -1}, {"mig-monitor", 0x82, "ID", 0, "MIG devices to list monitor capabilities files for", -1}, {"imex-channel", 0x83, "CHANNEL", 0, "IMEX channel ID(s) to inject", -1}, + {"no-persistenced", 0x84, NULL, 0, "Don't include the NVIDIA persistenced socket", -1}, + {"no-fabricmanager", 0x85, NULL, 0, "Don't include the NVIDIA fabricmanager socket", -1}, {0}, }, list_parser, @@ -70,6 +72,14 @@ list_parser(int key, char *arg, struct argp_state *state) if (str_join(&err, &ctx->imex_channels, arg, ",") < 0) goto fatal; break; + case 0x84: + if (str_join(&err, &ctx->driver_opts, "no-persistenced", " ") < 0) + goto fatal; + break; + case 0x85: + if (str_join(&err, &ctx->driver_opts, "no-fabricmanager", " ") < 0) + goto fatal; + break; case ARGP_KEY_END: if (state->argc == 1 || (state->argc == 2 && ctx->imex_channels != NULL)) { if ((ctx->devices = xstrdup(&err, "all")) == NULL) @@ -146,7 +156,7 @@ list_command(const struct context *ctx) warnx("permission error: %s", err.msg); goto fail; } - if ((drv = libnvc.driver_info_new(nvc, NULL)) == NULL || + if ((drv = libnvc.driver_info_new(nvc, ctx->driver_opts)) == NULL || (dev = libnvc.device_info_new(nvc, NULL)) == NULL) { warnx("detection error: %s", libnvc.error(nvc)); goto fail;