Makefile.user: Clean libuser/qom/ subdirectory

Commit dd83b06ae61cfa2dc4381ab49f365bd0995fc930 (qom: Introduce CPU
class) introduced a qom/ subdir in libuser/. It contains cpu.o once
built. That never gets cleaned up.

Add qom to the list of subdirectories to be cleaned.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Riku Voipio <riku.voipio@ipi.fi>
Cc: Blue Swirl <blauwirbel@gmail.com>
make_device_config.sh: Fix target path in generated dependency file

config-devices.mak.d is included from Makefile.target, i.e. from inside
the *-softmmu/ directory. It included the directory path, so never
applied to the actual config-devices.mak. Symptoms were spurious
dependency issues with default-configs/pci.mak.

Fix by using `basename` to strip the directory path.

Reported-by: Gerhard Wiesinger <lists@wiesinger.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Push state up to Object

qdev properties use the state member (an embryo of the "realized"
property) in order to disable setting them after a device has been
initialized.  So, in order to push qdev properties up to Object
we need to push this bit there too.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[AF: Replace state enum by realized boolean, requested by Anthony.]
Signed-off-by: Andreas Färber <afaerber@suse.de>
qom: Add "realized" property

Since we had to move the state field from DeviceState to Object, we cannot
delay the implementation of the "realized" property.  The property is
a trigger for two actions that propagate through the composition tree.
"Realize" is called when the property becomes true, and propagates in
pre-order; realize can fail if the values of the properties are not valid.
"Unrealize" is called when the property becomes false, and propagates in
post-order; unrealize cannot fail.

Realize/unrealize is separate from reset.  Reset propagation is a thorny
issue of its own.  We expect classes that care to implement a reset method
and call it from realize or realize_children, depending on whether
pre-order or post-order is more appropriate.

This patch adds four methods (realize, realize_children, unrealize,
unrealize_children) to ObjectClass, together with a default implementation
of realize_children and unrealize_children.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[PB: Added unrealize and (un)realize_children]
Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Generalize properties to Objects

The property machinery uses DeviceState arguments in a few places.
Replace this with Object so that we can push properties up.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[AF: Fixed indentation in set_taddr(), drop use of object_get_id().]
Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Move bulk of qdev-properties.c to qom/object-properties.c

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[AF: Move to new qom/object-properties.c, update documentation.]
Signed-off-by: Andreas Färber <afaerber@suse.de>
qom: Push static properties to Object

This patch is made much larger by the need to touch all assignments
of props.  The interesting changes are in hw/qdev-monitor.c,
hw/qdev-properties.c, hw/qdev.c, hw/qdev.h, include/qemu/object.h,
qom/object.c.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[AF: Convert arm_gic_properties as well]
Signed-off-by: Andreas Färber <afaerber@suse.de>
qom: Add QERR_PROPERTY_SET_AFTER_REALIZE

Add a new QError QERR_PROPERTY_SET_AFTER_REALIZE for attempts
to set a QOM or qdev property after the object/device has been
realized. This allows a slightly more informative diagnostic
than the previous "Insufficient permission" message.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[AF: Use object_get_typename() in place of object_get_id().]
Signed-off-by: Andreas Färber <afaerber@suse.de>