]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain_conf: Fix check for hyperv stimer
authorTim Wiederhake <twiederh@redhat.com>
Thu, 4 Mar 2021 08:35:31 +0000 (09:35 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 4 Mar 2021 10:44:23 +0000 (11:44 +0100)
VIR_DOMAIN_HYPERV_STIMER happens to have the same numerical value as
VIR_DOMAIN_FEATURE_HYPERV, resulting in the if-block to always being
executed when a "<hyperv>" tag is found, whether or not it actually
contained a "<stimer>" tag. This had no ill effects, as virXPathNodeSet()
would simply return 0 if that tag does not exist.

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

index 48fd078b903963ba6bdcc1feef7fb53af5fecef1..05b6cb300063fea38b369694bce253dab1505a35 100644 (file)
@@ -18460,7 +18460,7 @@ virDomainFeaturesDefParse(virDomainDefPtr def,
         ctxt->node = node;
     }
 
-    if (def->features[VIR_DOMAIN_HYPERV_STIMER] == VIR_TRISTATE_SWITCH_ON) {
+    if (def->hyperv_features[VIR_DOMAIN_HYPERV_STIMER] == VIR_TRISTATE_SWITCH_ON) {
         int value;
         if ((n = virXPathNodeSet("./features/hyperv/stimer/*", ctxt, &nodes)) < 0)
             return -1;