vring: create a common function to parse descriptors

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
vring: factor common code for error exits

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
dataplane: change vring API to use VirtQueueElement

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
dataplane: replace hostmem with memory_region_find

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qdev: document assumption that unrealize is followed by finalize

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.

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: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
serial: use 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: use instance_finalize instead of exit

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ahci: use 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: use 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: use instance_finalize instead of exit

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