summary refs log tree commit diff stats
path: root/qom/cpu.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-10-10 13:25:46 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-10-10 13:25:46 +0100
commit567d0a19c7998fa366598b83d5a6e5f0759d3ea9 (patch)
tree7cac6341df37f80a05a7d71bdabe1ff3892c9994 /qom/cpu.c
parent530049bc1dcc24c1178a29d99ca08b6dd08413e0 (diff)
parente0dd5fd41a1a38766009f442967fab700d2d0550 (diff)
downloadfocaccia-qemu-567d0a19c7998fa366598b83d5a6e5f0759d3ea9.tar.gz
focaccia-qemu-567d0a19c7998fa366598b83d5a6e5f0759d3ea9.zip
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-and-machine-pull-request' into staging
x86 and machine queue, 2017-10-09

Includes x86, QOM, CPU, and option/config parsing patches.

Highlights:
* Deprecation of -nodefconfig option;
* MachineClass::valid_cpu_types field.

# gpg: Signature made Tue 10 Oct 2017 03:31:33 BST
# gpg:                using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-and-machine-pull-request:
  x86: Correct translation of some rdgsbase and wrgsbase encodings
  vl: exit if maxcpus is negative
  qom: update doc comment for type_register[_static]()
  config: qemu_config_parse() return number of config groups
  qemu-options: Deprecate -nodefconfig
  vl: Eliminate defconfig variable
  machine: Add a valid_cpu_types property
  qom/cpu: move cpu_model null check to cpu_class_by_name()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qom/cpu.c')
-rw-r--r--qom/cpu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/qom/cpu.c b/qom/cpu.c
index 94fa8fe005..54c9452b1c 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -316,7 +316,12 @@ static bool cpu_common_has_work(CPUState *cs)
 
 ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model)
 {
-    CPUClass *cc = CPU_CLASS(object_class_by_name(typename));
+    CPUClass *cc;
+
+    if (!cpu_model) {
+        return NULL;
+    }
+    cc = CPU_CLASS(object_class_by_name(typename));
 
     return cc->class_by_name(cpu_model);
 }