dev: device and port specific args
Type: improvement
Change-Id: I26124a50d8e05d6f01a2e6dbc4bc8183fb5a09c4
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vnet/dev/config.c b/src/vnet/dev/config.c
index 091d83e..3026eaa 100644
--- a/src/vnet/dev/config.c
+++ b/src/vnet/dev/config.c
@@ -41,6 +41,9 @@
else if (unformat (input, "flags %U", unformat_vnet_dev_port_flags,
&args->flags))
;
+ else if (unformat (input, "args %U", unformat_single_quoted_string,
+ &args->args))
+ ;
else
{
err = clib_error_return (0, "unknown input '%U'",
@@ -50,7 +53,6 @@
}
return err;
}
-
static clib_error_t *
vnet_dev_config_one_device (vlib_main_t *vm, unformat_input_t *input,
char *device_id)
@@ -71,6 +73,9 @@
else if (unformat (input, "flags %U", unformat_vnet_dev_flags,
&args.flags))
;
+ else if (unformat (input, "args %U", unformat_single_quoted_string,
+ &args.args))
+ ;
else if (unformat (input, "port %u %U", &n, unformat_vlib_cli_sub_input,
&sub_input))
{
@@ -96,6 +101,7 @@
clib_memcpy (args.device_id, device_id, sizeof (args.device_id));
rv = vnet_dev_api_attach (vm, &args);
+ vec_free (args.args);
if (rv == VNET_DEV_OK)
{