Received: from eggs.gnu.org ([208.118.235.92]:59754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJT2u-0002kJ-9j for qemu-devel@nongnu.org; Wed, 03 Oct 2012 13:47:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJT2r-0006Sd-TX for qemu-devel@nongnu.org; Wed, 03 Oct 2012 13:47:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJT2r-0006SK-K3 for qemu-devel@nongnu.org; Wed, 03 Oct 2012 13:47:41 -0400 From: Eduardo Habkost Date: Wed, 3 Oct 2012 14:48:32 -0300 Message-Id: <1349286518-28123-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 0/6] qdev: handle global properties after all instance_init calls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Anthony Liguori , Igor Mammedov Summary: - Object properties are registered by the classes' instance_init() functions - qdev_prop_set_globals() needs all properties to be registered before being called. - Hence, qdev_prop_set_globals() can't be called from device_initfn(). Reference: http://article.gmane.org/gmane.comp.emulators.qemu/173753 This series is a larger than the single-patch suggestion sent by Igor (URL above), just because I wanted to include a unit test for the new code. To do that, I pulled the qdev-split code sent previously to the list, so a qdev unit test could be written without pulling too many dependencies. Patches 1-3 are just code movement, patch 3 adds the qdev unit test, patches 5-6 finally introduce post_init(), and move the qdev_prop_set_globals() call to post_init(). Anthony Liguori (1): qdev: split up header so it can be used in cpu.h Eduardo Habkost (4): qdev: separate core from the code used only by qemu-system-* tests: unit tests for qdev global-properties handling qom: introduce post_init() function qdev: set globals on post_init() function Igor Mammedov (1): qapi-types.h doesn't really need to include qemu-common.h hw/Makefile.objs | 1 + hw/irq.h | 2 + hw/mc146818rtc.c | 1 + hw/qdev-addr.c | 1 + hw/qdev-core.h | 240 ++++++++++++++++++++++++++ hw/qdev-monitor.h | 16 ++ hw/qdev-properties-system.c | 329 ++++++++++++++++++++++++++++++++++++ hw/qdev-properties.c | 321 +---------------------------------- hw/qdev-properties.h | 131 +++++++++++++++ hw/qdev-system.c | 93 +++++++++++ hw/qdev.c | 102 +---------- hw/qdev.h | 371 +---------------------------------------- include/qemu/object.h | 3 + qom/object.c | 14 ++ scripts/qapi-types.py | 3 +- tests/Makefile | 6 + tests/fake-qdev.c | 52 ++++++ tests/test-qdev-global-props.c | 178 ++++++++++++++++++++ 18 files changed, 1083 insertions(+), 781 deletions(-) create mode 100644 hw/qdev-core.h create mode 100644 hw/qdev-monitor.h create mode 100644 hw/qdev-properties-system.c create mode 100644 hw/qdev-properties.h create mode 100644 hw/qdev-system.c create mode 100644 tests/fake-qdev.c create mode 100644 tests/test-qdev-global-props.c -- 1.7.11.4