[ovs-dev] [PATCH] dpdk: Redirect DPDK log to OVS logging subsystem.
Aaron Conole
aconole at redhat.com
Thu Mar 2 19:22:04 UTC 2017
Ilya Maximets <i.maximets at samsung.com> writes:
> This should be helpful for have all the logs in one place.
> 'ovs-appctl vlog' commands for 'dpdk' module can be used
> to configure the log level. Lower bound for DPDK logging
> (--log-level) still can be passed through 'dpdk-extra' field.
>
> Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
> ---
+1 - good change!
...
> diff --git a/lib/dpdk.c b/lib/dpdk.c
> index c1626e2..eb03ec9 100644
> --- a/lib/dpdk.c
> +++ b/lib/dpdk.c
...
> @@ -262,6 +266,45 @@ argv_release(char **dpdk_argv, char **dpdk_argv_release, size_t dpdk_argc)
> free(dpdk_argv);
> }
>
> +static ssize_t
> +dpdk_log_write(void *c OVS_UNUSED, const char *buf, size_t size)
> +{
> + char *str = xmalloc(size + 1);
> +
> + strncpy(str, buf, size);
> + str[size] = '\0';
Small nit - does it make more sense here to use xmemdup0(), instead? If
you're not worried about non-printable characters, what about xstrdup or
even xasprintf("%s", buf)?
-Aaron
More information about the dev
mailing list