[PATCH 0/6] virXMLPropStringLimit removal follow-up

Peter Krempa pkrempa at redhat.com
Thu Nov 25 12:59:05 UTC 2021


Tim pointed out that some of the code could be simplified a bit more by
using virTristateBool parsing functions and also that strnlen could be
used instead of strlen.

This series does those cleanups as well as one further refactor of
character verification in virDomainDeviceLoadparmIsValid.

Peter Krempa (6):
  util: enum: Add helpers for converting virTristate* to a plain bool
  conf: seclabel: Parse booleans using virXMLPropTristateBool instead of
    virStringParseYesNo
  internal: Add STRLIM macro for checking string length using strnlen()
  virDomainDeviceLoadparmIsValid: Simplify value lenght check
  virDomainDeviceLoadparmIsValid: Use 'strspn' instead of a loop
  conf: domain: Convert all string length checks to STRLIM

 src/conf/domain_conf.c                        | 83 +++++++------------
 src/internal.h                                |  9 ++
 src/libvirt_private.syms                      |  2 +
 src/util/virenum.c                            | 54 ++++++++++++
 src/util/virenum.h                            |  2 +
 .../machine-loadparm-s390-char-invalid.err    |  2 +-
 .../machine-loadparm-s390-len-invalid.err     |  2 +-
 7 files changed, 99 insertions(+), 55 deletions(-)

-- 
2.31.1




More information about the libvir-list mailing list