qdev: Prepare realize/unrealize hooks for BusState

Add a "realize" property calling realize/unrealize hooks as for devices.

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Realize buses on device realization

Integrate (un)realization of child buses with realization/unrealization
of the device hosting them. Code in device_unparent() is reordered for
unrealization of buses to work as part of device unrealization.

That way no changes need to be made to bus instantiation.

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
pci: Move VMState registration/unregistration to QOM realize/unrealize

Use the realize and unrealize hooks to register and unregister
vmstate_pcibus respectively.

Relocate some stuff to avoid forward declarations.

Signed-off-by: Bandan Das <bsd@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>