qdev: add the device to the QOM tree before using it to set a link

Test steps:
  (qemu) device_add e1000,addr=adsf
  Property 'e1000.addr' doesn't take value 'adsf'
  (qemu) info qtree
Then qemu crashed.

Currently we set a link to the new device for qdev parent bus, but the
device hasn't been added to QOM tree. When it fails to set properties,
object_unparent() can't cleanup the device.

This patch moves qdev_set_parent_bus() back to object_property_add_child(),
we only needs to unref the object if setting properties fails.

Signed-off-by: Amos Kong <akong@redhat.com>
---
V2: fix bz by adjust the initialization order (Paolo)
workaround trace error

Signed-off-by: Amos Kong <akong@redhat.com>
(cherry picked from commit df229444210a25c23841a8e02fb96f498449c9ca)
qapi: cleanup redundant variable

No need to re-append an expr list, it's ok to return schema.exprs

Signed-off-by: Amos Kong <akong@redhat.com>
qapi: store raw exprs

Signed-off-by: Amos Kong <akong@redhat.com>
qapi: introduce qapi-introspect.py to generate qapi-introspect.h

Signed-off-by: Amos Kong <akong@redhat.com>
qmp: full introspection support for QMP

This patch introduces a new monitor command to query QMP schema
information, the return data is a range of schema structs, which
contains the useful metadata to help management to check supported
features, QMP commands detail, etc.

It parses all json definition in qapi-schema.json, and generate a
dynamic struct tree, QMP infrastructure will convert the tree to
json string and return to QMP client.

I defined a 'DataObject' union in qapi-schema.json, it's used to
describe the dynamic data struct.

I also added a document about QMP full introspection support
(docs/qmp-full-introspection.txt), it helps to use the new interface
and understand the abstract method in describing the dynamic struct.

TODO:
Wenchao Xia is working to convert QMP events to qapi-schema.json,
then event can also be queried by this interface.

I will introduce another command 'query-qga-schema' to query QGA
schema information, it's easy to add this support based on this
patch.

Signed-off-by: Amos Kong <akong@redhat.com>
fix

Signed-off-by: Amos Kong <akong@redhat.com>
fix

Signed-off-by: Amos Kong <akong@redhat.com>
fix

Signed-off-by: Amos Kong <akong@redhat.com>
fix

Signed-off-by: Amos Kong <akong@redhat.com>
fix

Signed-off-by: Amos Kong <akong@redhat.com>
fix

Signed-off-by: Amos Kong <akong@redhat.com>