From: Jiri Denemark Date: Mon, 22 Jun 2015 08:27:05 +0000 (+0200) Subject: conf: Simplify conditions in CPU parser/formatter X-Git-Tag: v2.0.0-rc1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0966f0d7e090899642ae35b2f1d551ac630382ec;p=thirdparty%2Flibvirt.git conf: Simplify conditions in CPU parser/formatter Signed-off-by: Jiri Denemark --- diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 7230b894ba..b71528ef5e 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;