[libvirt PATCH 2/2] virDomainFeaturesHyperVDefParse: Compare hyperv mode

Tim Wiederhake twiederh at redhat.com
Tue Dec 14 16:53:43 UTC 2021


Previous patch neglected the possibility of different modes for hyperv
(e.g. "custom" and "passthrough").

Fixes: 6e83fafe331dd0b4fb19aa384c3dd36b3af62933
Signed-off-by: Tim Wiederhake <twiederh at redhat.com>
---
 src/conf/domain_conf.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9a21ac10ce..2d8851fa11 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -21734,6 +21734,15 @@ virDomainDefFeaturesCheckABIStability(virDomainDef *src,
     }
 
     /* hyperv */
+    if (src->features[VIR_DOMAIN_FEATURE_HYPERV] != dst->features[VIR_DOMAIN_FEATURE_HYPERV]) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("State of HyperV enlightenment mode differs: "
+                         "source: '%s', destination: '%s'"),
+                       virDomainHyperVModeTypeToString(src->features[VIR_DOMAIN_FEATURE_HYPERV]),
+                       virDomainHyperVModeTypeToString(dst->features[VIR_DOMAIN_FEATURE_HYPERV]));
+        return false;
+    }
+
     if (src->features[VIR_DOMAIN_FEATURE_HYPERV] != VIR_DOMAIN_HYPERV_MODE_NONE) {
         for (i = 0; i < VIR_DOMAIN_HYPERV_LAST; i++) {
             switch ((virDomainHyperv) i) {
-- 
2.31.1




More information about the libvir-list mailing list