summary refs log tree commit diff stats
path: root/hw/core/qdev.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-01-11 13:35:48 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-01-11 13:35:48 +0000
commite53f7796fbe71a5c7c24ffebf04b4aa9a759da36 (patch)
tree64cad2b5700d85dcf5bf0f4091ceac2231d1872e /hw/core/qdev.c
parent291741033f611a4f0bbce3f7c9dead84ce315f96 (diff)
parentd769f0dfeeaa1554a38fedb16bb20a4b0ecf793c (diff)
downloadfocaccia-qemu-e53f7796fbe71a5c7c24ffebf04b4aa9a759da36.tar.gz
focaccia-qemu-e53f7796fbe71a5c7c24ffebf04b4aa9a759da36.zip
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging
Machine queue, 2019-01-10

* Simplify GlobalProperty array declarations (Eduardo Habkost)
* Deprecate cpu-add commands (Kashyap Chamarthy)
* range/memory-device cleanups (David Hildenbrand)
* Fix -device scsi-hd,help regression (Marc-André Lureau)
* Fix crash when -global generates multiple warnings (Eduardo
  Habkost)

# gpg: Signature made Thu 10 Jan 2019 14:28:23 GMT
# gpg:                using RSA key 2807936F984DC5A6
# 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/machine-next-pull-request:
  qom: Don't keep error value between object_property_parse() calls
  qdev: fix -device scsi-hd,help regression
  machine: Use shorter format for GlobalProperty arrays
  machine: Eliminate unnecessary stringify() usage
  spapr: Eliminate SPAPR_PCI_2_7_MMIO_WIN_SIZE macro
  memory-device: rewrite address assignment using ranges
  range: add some more functions
  Mention that QMP 'cpu-add' will be deprecated
  Update that HMP 'cpu-add' is deprecated in 4.0
  qemu-deprecated.texi: Rename the HMP section

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/core/qdev.c')
-rw-r--r--hw/core/qdev.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 3769a2bccb..47bddacb4f 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -975,10 +975,13 @@ void object_apply_compat_props(Object *obj)
     if (object_dynamic_cast(qdev_get_machine(), TYPE_MACHINE)) {
         MachineState *m = MACHINE(qdev_get_machine());
         MachineClass *mc = MACHINE_GET_CLASS(m);
-        AccelClass *ac = ACCEL_GET_CLASS(m->accelerator);
 
-        if (ac->compat_props) {
-            object_apply_global_props(obj, ac->compat_props, &error_abort);
+        if (m->accelerator) {
+            AccelClass *ac = ACCEL_GET_CLASS(m->accelerator);
+
+            if (ac->compat_props) {
+                object_apply_global_props(obj, ac->compat_props, &error_abort);
+            }
         }
         object_apply_global_props(obj, mc->compat_props, &error_abort);
     }