util: xml: Extract implementation of xml property -> enum parsing to a common helper
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 <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>
Reviewed-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

jfehlig/libvirt,crobinso/libvirt,olafhering/libvirt,crobinso/libvirt,olafhering/libvirt,libvirt/libvirt,zippy2/libvirt,nertpinx/libvirt,libvirt/libvirt,libvirt/libvirt,nertpinx/libvirt,crobinso/libvirt,zippy2/libvirt,olafhering/libvirt,zippy2/libvirt,zippy2/libvirt,jfehlig/libvirt,crobinso/libvirt,jfehlig/libvirt,libvirt/libvirt,jfehlig/libvirt,olafhering/libvirt,nertpinx/libvirt,nertpinx/libvirt,nertpinx/libvirt