From: Jiri Denemark Date: Tue, 2 Jun 2020 19:06:02 +0000 (+0200) Subject: qemu: Pass migratable=on|off property for -cpu host X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cfdceb9754bde5d161c21a65e621ef20c47f1eaf;p=libvirt.git qemu: Pass migratable=on|off property for -cpu host Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 419eca5675..d9e99d9d1a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6254,6 +6254,21 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, } virBufferAddLit(buf, ",aarch64=off"); } + + if (cpu->migratable) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_MIGRATABLE)) { + virBufferAsprintf(buf, ",migratable=%s", + virTristateSwitchTypeToString(cpu->migratable)); + } else if (ARCH_IS_X86(def->os.arch) && + cpu->migratable == VIR_TRISTATE_SWITCH_OFF) { + /* This is the default on x86 */ + } else { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Migratable attribute for host-passthrough " + "CPU is not supported by QEMU binary")); + return -1; + } + } break; case VIR_CPU_MODE_HOST_MODEL: