[RESEND PATCH 0/2] Adding const to many libxl/xl functions

Elliott Mitchell posted 2 patches 3 years, 2 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/cover.1613496229.git.ehem+xen@m5p.com
tools/include/libxl_json.h        | 22 ++++++++++++----------
tools/libs/light/gentypes.py      |  8 ++++----
tools/libs/light/libxl_cpuid.c    |  2 +-
tools/libs/light/libxl_internal.c |  4 ++--
tools/libs/light/libxl_internal.h | 18 +++++++++---------
tools/libs/light/libxl_json.c     | 18 ++++++++++--------
tools/libs/light/libxl_nocpuid.c  |  4 ++--
tools/xl/xl.h                     |  2 +-
tools/xl/xl_info.c                |  2 +-
tools/xl/xl_sxp.c                 |  6 +++---
10 files changed, 45 insertions(+), 41 deletions(-)
[RESEND PATCH 0/2] Adding const to many libxl/xl functions
Posted by Elliott Mitchell 3 years, 2 months ago
The rest of the series seems hopeless for stable, so right now I'm merely
resending the 2 which are simpler.  During the full series I came across
a bunch of xl and then libxl functions which could have arguments
declared const.

These are the input arguments of *_is_empty() and *_is_default(), which
are merely read from.  There are also *_gen_json() functions where the
yajl handle needs to be writeable, but the input data structure isn't
modified.

The second is merely spreading these further outwards.  Once libxl marks
its function's arguments const, portions of `xl` can similarly have
functions marked const.

NOTE: Order is important on these two!

Elliott Mitchell (2):
  tools/libxl: Mark pointer args of many functions constant
  tools/xl: Mark libxl_domain_config * arg of printf_info_*() const

 tools/include/libxl_json.h        | 22 ++++++++++++----------
 tools/libs/light/gentypes.py      |  8 ++++----
 tools/libs/light/libxl_cpuid.c    |  2 +-
 tools/libs/light/libxl_internal.c |  4 ++--
 tools/libs/light/libxl_internal.h | 18 +++++++++---------
 tools/libs/light/libxl_json.c     | 18 ++++++++++--------
 tools/libs/light/libxl_nocpuid.c  |  4 ++--
 tools/xl/xl.h                     |  2 +-
 tools/xl/xl_info.c                |  2 +-
 tools/xl/xl_sxp.c                 |  6 +++---
 10 files changed, 45 insertions(+), 41 deletions(-)

-- 


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445