]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Pass migratable=on|off property for -cpu host
authorJiri Denemark <jdenemar@redhat.com>
Tue, 2 Jun 2020 19:06:02 +0000 (21:06 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 9 Jun 2020 18:32:50 +0000 (20:32 +0200)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_command.c

index 419eca5675cc15c7cf3edccfac54a0b7386b9ab3..d9e99d9d1a9fccfd39908fc9a7d729098936ebe8 100644 (file)
@@ -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: