]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Don't accept dummy values for <memoryBacking/> attributes
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 21 Feb 2017 16:24:17 +0000 (17:24 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 22 Feb 2017 08:11:33 +0000 (09:11 +0100)
commit0888cb6ab4a8282dd4a67a01be8f2fda28661bfd
tree1cde26a1cd24741ee25de2bd6fc6a56ae0f25a6e
parent5ad03b9db2186d5b1d09f33e5ab0daa683054675
conf: Don't accept dummy values for <memoryBacking/> attributes

Our virSomeEnumTypeFromString() functions return either the value
of item from the enum or -1 on error. Usually however the value 0
means 'this value is not set in the domain XML, use some sensible
default'. Therefore, we don't accept corresponding string in
domain XML, for instance:

<memoryBacking>
  <source mode="none"/>
  <access mode="default"/>
  <allocation mode="none"/>
</memoryBacking>

should be rejected as invalid XML.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c