Re: [RFC 5/5] livepatch: Selftests of the API for tracking system state changes

From: Miroslav Benes
Date: Fri Jun 21 2019 - 07:54:42 EST


> diff --git a/lib/livepatch/test_klp_state.c b/lib/livepatch/test_klp_state.c
> new file mode 100644
> index 000000000000..c43dc2f2e01d
> --- /dev/null
> +++ b/lib/livepatch/test_klp_state.c
> @@ -0,0 +1,161 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (C) 2019 SUSE
> +
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> +#include <linux/module.h>
> +#include <linux/kernel.h>
> +#include <linux/printk.h>
> +#include <linux/livepatch.h>
> +
> +#define CONSOLE_LOGLEVEL_STATE 1
> +/* Version 1 does not support migration. */
> +#define CONSOLE_LOGLEVEL_STATE_VERSION 1

[...]

> +static struct klp_state states[] = {
> + {
> + .id = CONSOLE_LOGLEVEL_STATE,
> + .version = 1,

s/1/CONSOLE_LOGLEVEL_STATE_VERSION/

Miroslav