[PATCH] conf: Simplify conditions in CPU parser/formatter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/conf/cpu_conf.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 7230b89..b71528e 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -330,8 +330,7 @@ virCPUDefParseXML(xmlNodePtr node,
         goto error;
 
     if (n > 0) {
-        if (!def->model && def->mode != VIR_CPU_MODE_HOST_MODEL &&
-            def->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) {
+        if (!def->model && def->mode == VIR_CPU_MODE_CUSTOM) {
             virReportError(VIR_ERR_XML_ERROR, "%s",
                            _("Non-empty feature list specified without "
                              "CPU model"));
@@ -518,10 +517,7 @@ virCPUDefFormatBuf(virBufferPtr buf,
                       (def->mode == VIR_CPU_MODE_HOST_MODEL ||
                        (def->mode == VIR_CPU_MODE_CUSTOM && def->model)));
 
-    if (!def->model &&
-        def->mode != VIR_CPU_MODE_HOST_MODEL &&
-        def->mode != VIR_CPU_MODE_HOST_PASSTHROUGH &&
-        def->nfeatures) {
+    if (!def->model && def->mode == VIR_CPU_MODE_CUSTOM && def->nfeatures) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Non-empty feature list specified without CPU model"));
         return -1;
-- 
2.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]