]> xenbits.xensource.com Git - libvirt.git/commitdiff
PowerPC : Forbid NULL CPU model with 'host-model' mode.
authorPrerna Saxena <prerna@linux.vnet.ibm.com>
Sun, 15 Feb 2015 04:24:15 +0000 (09:54 +0530)
committerJán Tomko <jtomko@redhat.com>
Tue, 17 Feb 2015 11:20:40 +0000 (12:20 +0100)
PowerPC : Forbid NULL CPU model with 'host-model' mode in qemu command line.

This ensures that an XML such as following:
...
  <cpu mode='host-model'>
    <model fallback='allow'/>
  </cpu>
...

will not generate a '-cpu host,compat=(null)' command line with qemu-system-ppc64.

Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
src/qemu/qemu_command.c

index 8e864abd5e026f94ce18f35701f43ee5f70a3882..743d6f01c3ea1f72f55711b9c42cd125fcf8eec0 100644 (file)
@@ -6691,7 +6691,8 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
         virBufferAddLit(buf, "host");
 
         if (ARCH_IS_PPC64(def->os.arch) &&
-            cpu->mode == VIR_CPU_MODE_HOST_MODEL) {
+            cpu->mode == VIR_CPU_MODE_HOST_MODEL &&
+            def->cpu->model != NULL) {
             virBufferAsprintf(buf, ",compat=%s", def->cpu->model);
         } else {
             featCpu = cpu;