summary refs log tree commit diff stats
path: root/hw/core/qdev.c
diff options
context:
space:
mode:
authorAnthony Liguori <anthony@codemonkey.ws>2013-08-20 09:51:53 -0500
committerAnthony Liguori <anthony@codemonkey.ws>2013-08-20 09:51:53 -0500
commit237e4f92a81696e5359766a7f19a77a9ff1d02e5 (patch)
treeae60a299d73e3f0742bf4238c3c379466510d7ad /hw/core/qdev.c
parentbc02fb304c6cc0f1dd0809545d226df2d6f5c093 (diff)
parent321bc0b2b27aa2dd64bf12e0e2a0f323a4903ecf (diff)
downloadfocaccia-qemu-237e4f92a81696e5359766a7f19a77a9ff1d02e5.tar.gz
focaccia-qemu-237e4f92a81696e5359766a7f19a77a9ff1d02e5.zip
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
QOM CPUState refactorings / X86CPU

* gdbstub coprocessor register count bugfix
* QOM instance_post_init infrastructure to override dynamic properties
* X86CPU HyperV preparations for CPU subclasses

# gpg: Signature made Fri 16 Aug 2013 11:49:02 AM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

# By Eduardo Habkost (3) and others
# Via Andreas Färber
* afaerber/tags/qom-cpu-for-anthony:
  cpus: Use cpu_is_stopped() efficiently
  target-i386: Move hyperv_* static globals to X86CPU
  qdev: Set globals in instance_post_init function
  qom: Introduce instance_post_init hook
  tests: Unit tests for qdev global properties handling
  gdbstub: Fix gdb_register_coprocessor() register counting
Diffstat (limited to 'hw/core/qdev.c')
-rw-r--r--hw/core/qdev.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 9190a7ee76..758de9fccc 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -752,7 +752,6 @@ static void device_initfn(Object *obj)
         }
         class = object_class_get_parent(class);
     } while (class != object_class_by_name(TYPE_DEVICE));
-    qdev_prop_set_globals(dev, &err);
     if (err != NULL) {
         qerror_report_err(err);
         error_free(err);
@@ -764,6 +763,15 @@ static void device_initfn(Object *obj)
     assert_no_error(err);
 }
 
+static void device_post_init(Object *obj)
+{
+    DeviceState *dev = DEVICE(obj);
+    Error *err = NULL;
+
+    qdev_prop_set_globals(dev, &err);
+    assert_no_error(err);
+}
+
 /* Unlink device from bus and free the structure.  */
 static void device_finalize(Object *obj)
 {
@@ -853,6 +861,7 @@ static const TypeInfo device_type_info = {
     .parent = TYPE_OBJECT,
     .instance_size = sizeof(DeviceState),
     .instance_init = device_initfn,
+    .instance_post_init = device_post_init,
     .instance_finalize = device_finalize,
     .class_base_init = device_class_base_init,
     .class_init = device_class_init,