]> git.proxmox.com Git - mirror_qemu.git/commit
vfio-pci: Fail initfn on DMA mapping errors
authorAlex Williamson <alex.williamson@redhat.com>
Thu, 16 Jan 2014 16:22:07 +0000 (09:22 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 16 Jan 2014 16:22:07 +0000 (09:22 -0700)
commit87ca1f77b1c406137fe36ab73b2dc91fb75f8d0a
treef96d347ac11f7a50cee6abdd30175ef64f633ef3
parentd3a2fd9b29e43e202315d5e99399b99622469c4a
vfio-pci: Fail initfn on DMA mapping errors

The vfio-pci initfn will currently succeed even if DMA mappings fail.
A typical reason for failure is if the user does not have sufficient
privilege to lock all the memory for the guest.  In this case, the
device gets attached, but can only access a portion of guest memory
and is extremely unlikely to work.

DMA mappings are done via a MemoryListener, which provides no direct
error return path.  We therefore stuff the errno into our container
structure and check for error after registration completes.  We can
also test for mapping errors during runtime, but our only option for
resolution at that point is to kill the guest with a hw_error.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/misc/vfio.c