qdev: register properties as class properties
commit77b06bba62034a87cc61a9c8de1309ae3e527d97
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 10 Jan 2020 15:30:34 +0000 (10 19:30 +0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Jan 2020 19:59:16 +0000 (24 20:59 +0100)
tree31644878066667339e6adb57fe026b74cdb78a5a
parentc68fc9359ba08594def82050e093a039376caddc
qdev: register properties as class properties

Use class properties facilities to add properties to the class during
device_class_set_props().

qdev_property_add_static() must be adapted as PropertyInfo now
operates with classes (and not instances), so we must
set_default_value() on the ObjectProperty, before calling its init()
method on the object instance.

Also, PropertyInfo.create() is now exclusively used for class
properties. Fortunately, qdev_property_add_static() is only used in
target/arm/cpu.c so far, which doesn't use "link" properties (that
require create()).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200110153039.1379601-22-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/core/qdev-properties.c
hw/core/qdev.c
include/hw/qdev-core.h