]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: xml: Extract implementation of xml property -> enum parsing to a common helper
authorPeter Krempa <pkrempa@redhat.com>
Thu, 6 May 2021 11:53:18 +0000 (13:53 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 7 May 2021 08:06:18 +0000 (10:06 +0200)
commit0420c325ceffa2c95bd1dbc9913ac4fc78b4eca6
treeb1544f86d02f68c06e3cd89e09baeb7c80e9eb43
parent4ef4476d3abd3d4eeff3a71ad9324df072c8405f
util: xml: Extract implementation of xml property -> enum parsing to a common helper

virXMLPropTristateBool/virXMLPropTristateSwitch/virXMLPropEnum can be
implemented using the same internal code. Extract it into a new function
called virXMLPropEnumInternal, which will also simplify adding versions
of these functions with a custom default value.

This way we'll be able to always initialize @result so that unused value
bugs can be prevented.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virxml.c