提交 659a92f2 编写于 作者: J Jiri Denemark

cpu_conf: Simplify formatting of guest CPU attributes

Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 4fd179f5
......@@ -604,20 +604,20 @@ virCPUDefFormatBufFull(virBufferPtr buf,
if (!def)
return 0;
/* Format attributes */
if (def->type == VIR_CPU_TYPE_GUEST) {
/* Format attributes for guest CPUs unless they only specify
* topology or cache. */
if (def->type == VIR_CPU_TYPE_GUEST &&
(def->mode != VIR_CPU_MODE_CUSTOM || def->model)) {
const char *tmp;
if (def->mode != VIR_CPU_MODE_CUSTOM || def->model) {
if (!(tmp = virCPUModeTypeToString(def->mode))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected CPU mode %d"), def->mode);
goto cleanup;
}
virBufferAsprintf(&attributeBuf, " mode='%s'", tmp);
}
if (def->model && def->mode == VIR_CPU_MODE_CUSTOM) {
if (def->mode == VIR_CPU_MODE_CUSTOM) {
if (!(tmp = virCPUMatchTypeToString(def->match))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected CPU match policy %d"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册