[LTP] [PATCH] migrate_pages02: check file exist before opening it

Jan Stancek jstancek@redhat.com
Sun Mar 6 19:51:22 CET 2022


> +               "?NUMA_BALANCING",
You probably meant "?"NUMA_BALANCING

>
> Maybe we just need to enhance the .save_restore with another parameter;
> a value to set the knob to if it does exists, so in add_key05.c it would
> look like:
>
> struct tst_path_val {
>         const char *path;
>         const char *val;
> };
>
>         .save_restore = (const struct tst_path_val const[]) {
>                 {"?/proc/sys/kernel/keys/gc_delay", "1"},
>                 {"?/proc/sys/kernel/keys/maxkeys", "200"},
>                 {"?/proc/sys/kernel/keys/maxbytes", "20000"}
>                 NULL,
>         },
>
> And in cases we do not need to set value we would just pass NULL as val...

That should work for most testcases, I don't recall one where we need
to cycle through more values.



More information about the ltp mailing list