]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen.git/commit
vfio: Generalize vfio_listener_region_add failure path
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 30 Sep 2015 02:13:52 +0000 (12:13 +1000)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 5 Oct 2015 18:37:02 +0000 (12:37 -0600)
commitac6dc3894fbb6775245565229953879a0263d27f
tree37200e10860b83df51a5ca2690be8618cc8ba126
parentee0bf0e59bb1c07c0196142f2ecfd88f7f8b194e
vfio: Generalize vfio_listener_region_add failure path

If a DMA mapping operation fails in vfio_listener_region_add() it
checks to see if we've already completed initial setup of the
container.  If so it reports an error so the setup code can fail
gracefully, otherwise throws a hw_error().

There are other potential failure cases in vfio_listener_region_add()
which could benefit from the same logic, so move it to its own
fail: block.  Later patches can use this to extend other failure cases
to fail as gracefully as possible under the circumstances.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/common.c