]> git.proxmox.com Git - mirror_qemu.git/commit
vfio: cleanup vfio_get_device error path, remove vfio_populate_device callback
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 10 Feb 2015 17:25:44 +0000 (10:25 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 10 Feb 2015 17:25:44 +0000 (10:25 -0700)
commit217e9fdcadb1dc7462f4d92866314f626426fa82
tree20fa3fe01342fca506d75578f8383298577264a9
parent6e48e8f9e0f5b6b15c41f6f8a68c9bf330147d45
vfio: cleanup vfio_get_device error path, remove vfio_populate_device callback

Now that vfio_put_base_device is called unconditionally at instance_finalize
time, it can be called twice if vfio_populate_device fails.  This works
but it is slightly harder to follow.

Change vfio_get_device to not touch the vbasedev struct until it will
definitely succeed, moving the vfio_populate_device call back to vfio-pci.
This way, vfio_put_base_device will only be called once.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/common.c
hw/vfio/pci.c
include/hw/vfio/vfio-common.h