提交 f277fb39 编写于 作者: J Jiri Denemark

cpu: Update style in virCPUBaseline

To make it more consistent with the rest of the CPU driver code.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NCollin Walling <walling@linux.ibm.com>
上级 f8c9f6ea
...@@ -515,14 +515,14 @@ virCPUBaseline(virArch arch, ...@@ -515,14 +515,14 @@ virCPUBaseline(virArch arch,
VIR_DEBUG("models[%zu]=%s", i, models->models[i].name); VIR_DEBUG("models[%zu]=%s", i, models->models[i].name);
} }
if (cpus == NULL && ncpus != 0) { if (!cpus && ncpus != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("nonzero ncpus doesn't match with NULL cpus")); "%s", _("nonzero ncpus doesn't match with NULL cpus"));
return NULL; return NULL;
} }
if (ncpus < 1) { if (ncpus < 1) {
virReportError(VIR_ERR_INVALID_ARG, "%s", _("No CPUs given")); virReportError(VIR_ERR_INVALID_ARG, "%s", _("no CPUs given"));
return NULL; return NULL;
} }
...@@ -542,10 +542,10 @@ virCPUBaseline(virArch arch, ...@@ -542,10 +542,10 @@ virCPUBaseline(virArch arch,
if (arch == VIR_ARCH_NONE) if (arch == VIR_ARCH_NONE)
arch = cpus[0]->arch; arch = cpus[0]->arch;
if ((driver = cpuGetSubDriver(arch)) == NULL) if (!(driver = cpuGetSubDriver(arch)))
return NULL; return NULL;
if (driver->baseline == NULL) { if (!driver->baseline) {
virReportError(VIR_ERR_NO_SUPPORT, virReportError(VIR_ERR_NO_SUPPORT,
_("cannot compute baseline CPU of %s architecture"), _("cannot compute baseline CPU of %s architecture"),
virArchToString(arch)); virArchToString(arch));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册