mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 09:55:18 +00:00
conf: Simplify conditions in CPU parser/formatter
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
423015137a
commit
0966f0d7e0
@ -330,8 +330,7 @@ virCPUDefParseXML(xmlNodePtr node,
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
if (!def->model && def->mode != VIR_CPU_MODE_HOST_MODEL &&
|
if (!def->model && def->mode == VIR_CPU_MODE_CUSTOM) {
|
||||||
def->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) {
|
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
_("Non-empty feature list specified without "
|
_("Non-empty feature list specified without "
|
||||||
"CPU model"));
|
"CPU model"));
|
||||||
@ -518,10 +517,7 @@ virCPUDefFormatBuf(virBufferPtr buf,
|
|||||||
(def->mode == VIR_CPU_MODE_HOST_MODEL ||
|
(def->mode == VIR_CPU_MODE_HOST_MODEL ||
|
||||||
(def->mode == VIR_CPU_MODE_CUSTOM && def->model)));
|
(def->mode == VIR_CPU_MODE_CUSTOM && def->model)));
|
||||||
|
|
||||||
if (!def->model &&
|
if (!def->model && def->mode == VIR_CPU_MODE_CUSTOM && def->nfeatures) {
|
||||||
def->mode != VIR_CPU_MODE_HOST_MODEL &&
|
|
||||||
def->mode != VIR_CPU_MODE_HOST_PASSTHROUGH &&
|
|
||||||
def->nfeatures) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Non-empty feature list specified without CPU model"));
|
_("Non-empty feature list specified without CPU model"));
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user