From: Tim Wiederhake Date: Thu, 4 Mar 2021 08:35:31 +0000 (+0100) Subject: domain_conf: Fix check for hyperv stimer X-Git-Tag: v7.2.0-rc1~255 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bcdb634e1b62a081325ae6a6b1f66cbe57e4201c;p=thirdparty%2Flibvirt.git domain_conf: Fix check for hyperv stimer 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 "" tag is found, whether or not it actually contained a "" tag. This had no ill effects, as virXPathNodeSet() would simply return 0 if that tag does not exist. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 48fd078b90..05b6cb3000 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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;