9c6c51
From cc56efa7f1681ae29b8a5de14bd31d35029a249a Mon Sep 17 00:00:00 2001
9c6c51
Message-Id: <cc56efa7f1681ae29b8a5de14bd31d35029a249a@dist-git>
9c6c51
From: Andrea Bolognani <abologna@redhat.com>
9c6c51
Date: Tue, 4 Dec 2018 16:46:16 +0100
9c6c51
Subject: [PATCH] qemu: Drop duplicated code from
9c6c51
 qemuDomainDefValidateFeatures()
9c6c51
MIME-Version: 1.0
9c6c51
Content-Type: text/plain; charset=UTF-8
9c6c51
Content-Transfer-Encoding: 8bit
9c6c51
9c6c51
Both VIR_DOMAIN_FEATURE_HPT and VIR_DOMAIN_FEATURE_HTM are
9c6c51
handled in the exact same way, so we can remove some duplicated
9c6c51
code without losing any functionality.
9c6c51
9c6c51
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
9c6c51
(cherry picked from commit 094c97ffadda41bb2ce2dfe699710630218975f2)
9c6c51
9c6c51
https://bugzilla.redhat.com/show_bug.cgi?id=1647822
9c6c51
9c6c51
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
9c6c51
Reviewed-by: Ján Tomko <jtomko@redhat.com>
9c6c51
---
9c6c51
 src/qemu/qemu_domain.c | 14 +-------------
9c6c51
 1 file changed, 1 insertion(+), 13 deletions(-)
9c6c51
9c6c51
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
9c6c51
index 08f479fa1d..4fcca1e05a 100644
9c6c51
--- a/src/qemu/qemu_domain.c
9c6c51
+++ b/src/qemu/qemu_domain.c
9c6c51
@@ -3818,6 +3818,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
9c6c51
             break;
9c6c51
 
9c6c51
         case VIR_DOMAIN_FEATURE_HPT:
9c6c51
+        case VIR_DOMAIN_FEATURE_HTM:
9c6c51
             if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
9c6c51
                 !qemuDomainIsPSeries(def)) {
9c6c51
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
9c6c51
@@ -3852,19 +3853,6 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
9c6c51
             }
9c6c51
             break;
9c6c51
 
9c6c51
-        case VIR_DOMAIN_FEATURE_HTM:
9c6c51
-            if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
9c6c51
-                !qemuDomainIsPSeries(def)) {
9c6c51
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
9c6c51
-                               _("The '%s' feature is not supported for "
9c6c51
-                                 "architecture '%s' or machine type '%s'"),
9c6c51
-                               featureName,
9c6c51
-                               virArchToString(def->os.arch),
9c6c51
-                               def->os.machine);
9c6c51
-                return -1;
9c6c51
-            }
9c6c51
-            break;
9c6c51
-
9c6c51
         case VIR_DOMAIN_FEATURE_ACPI:
9c6c51
         case VIR_DOMAIN_FEATURE_APIC:
9c6c51
         case VIR_DOMAIN_FEATURE_PAE:
9c6c51
-- 
9c6c51
2.20.1
9c6c51