qdev: document assumption that unrealize is followed by finalize

This becomes important when undoing realize's initializations is split
in two places (unrealize and exit).

The way to fix this could be to split realize further in "alloc" (done
only one) and "realize" (can be undone).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pci: split exit and finalize

When converting devices to use out-of-BQL memory access, destruction
needs to be done in two phases.  First, the device is unrealized;
at this point, pending memory accesses can still be completed, but
no new accesses will be started.  The second part is freeing the
device, which happens only after the reference count drops to zero;
this means that all memory accesses are complete.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ac97: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
es1370: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hda: reclaim memory in instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
serial: reclaim memory in instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tpci200: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pci-assign: reclaim memory in instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ahci: reclaim memory in instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
msix: split msix_free from msix_uninit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cmd646: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide/piix: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide/via: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ivshmem: reclaim memory in instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pci-testdev: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
vfio: reclaim memory in instance_finalize instead of exit

This requires splitting vfio_teardown_msi, vfio_unmap_bar and
vfio_unmap_bars in two.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
e1000: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
eepro100: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ne2000: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pcnet: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>