On Fri, Dec 18, 2020 at 01:37:44PM -0800, Elliott Mitchell wrote: > Anything *_is_empty(), *_is_default(), or *_gen_json() is going to be > examining the pointed to thing, not modifying it. This potentially > results in higher-performance output. This also allows spreading > constants further, allowing more checking and security. > > Signed-off-by: Elliott Mitchell <ehem+...@m5p.com> > --- > diff --git a/tools/libs/light/libxl_internal.h > b/tools/libs/light/libxl_internal.h > index 028bc013d9..e3df881d08 100644 > --- a/tools/libs/light/libxl_internal.h > +++ b/tools/libs/light/libxl_internal.h [..] > -static inline bool libxl__string_is_default(char **s) > +static inline bool libxl__string_is_default(char *const *s)
That looks weird to not also have "char" been "const", but I've tried to change that and the compiler wasn't cooperative so I guess that's fine. > diff --git a/tools/libs/light/libxl_nocpuid.c > b/tools/libs/light/libxl_nocpuid.c > index f47336565b..73580351b3 100644 > --- a/tools/libs/light/libxl_nocpuid.c > +++ b/tools/libs/light/libxl_nocpuid.c > @@ -40,7 +40,7 @@ void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, > bool restore, > } > > yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand, > - libxl_cpuid_policy_list *pcpuid) > + const libxl_cpuid_policy_list *pcpuid) That change is missing in libxl_cpuid.c. The rest looks fine, so once libxl_cpuid.c is fix, you can have my Reviewed-by. Thanks, -- Anthony PERARD