]> xenbits.xensource.com Git - libvirt.git/commit
cpu_conf: Fix default value for CPU match attribute
authorJiri Denemark <jdenemar@redhat.com>
Tue, 12 Nov 2019 14:26:23 +0000 (15:26 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 25 Nov 2019 14:29:19 +0000 (15:29 +0100)
commit65fa7bba1a7b57e727bee51525d309c9afbc786b
tree64d1a111c645e555ec6fe7e0bb93b6e7bd753570
parentd3f2a8bd472a6de9546ec5ab0593606bf443ffd2
cpu_conf: Fix default value for CPU match attribute

Commit v0.8.4-66-g95ff6b18ec (9 years ago) changed the default value for
the cpu/@match attribute to 'exact' in a rather complicated way. It did
so only if <model> subelement was present and set -1 otherwise (which is
not expected to ever happen). Thus the following two equivalent XML
elements:

    <cpu mode='host-model'/>

and

    <cpu mode='host-model'>
      <model/>
    </cpu>

would be parsed differently. The former would end up with match == -1
while the latter would have match == 1 ('exact'). This is not a big deal
since the match attribute is ignored for host-model CPUs, but we can
simplify the code and make it a little bit saner anyway.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/cpu_conf.c
src/conf/cpu_conf.h