diff options
author | Ladi Prosek <lprosek@redhat.com> | 2016-12-16 13:31:22 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2017-01-22 13:20:42 +0000 |
commit | b782a56be725569fb68f92b81a01903d1652c5b0 (patch) | |
tree | c07056af08630fbdb6e0ea2c99c5245fb2e0f0fe /src/drivers/bus | |
parent | e45451c6994f6e93729ee3860e45fa965483356f (diff) | |
download | ipxe-b782a56be725569fb68f92b81a01903d1652c5b0.tar.gz |
[virtio] Simplify virtqueue shutdown
This commit introduces virtnet_free_virtqueues called on all virtqueue
error and shutdown paths. vpm_find_vqs no longer cleans up after itself
and instead expects virtnet_free_virtqueues to be always called to undo
its effect.
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/bus')
-rw-r--r-- | src/drivers/bus/virtio-pci.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/drivers/bus/virtio-pci.c b/src/drivers/bus/virtio-pci.c index 1fcf9bae0..c50602a31 100644 --- a/src/drivers/bus/virtio-pci.c +++ b/src/drivers/bus/virtio-pci.c @@ -391,7 +391,7 @@ int vpm_find_vqs(struct virtio_pci_modern_device *vdev, off * notify_offset_multiplier, 2, &vq->notification); if (err) { - goto err_map_notify; + return err; } } @@ -405,11 +405,4 @@ int vpm_find_vqs(struct virtio_pci_modern_device *vdev, vpm_iowrite16(vdev, &vdev->common, 1, COMMON_OFFSET(queue_enable)); } return 0; - -err_map_notify: - /* Undo the virtio_pci_map_capability calls. */ - while (i-- > 0) { - virtio_pci_unmap_capability(&vqs[i].notification); - } - return err; } |