render / rpms / libvirt

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