virtio-blk: improve virtqueue error to BLK_STS
authorHalil Pasic <pasic@linux.ibm.com>
Thu, 13 Feb 2020 12:37:28 +0000 (13:37 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 8 Mar 2020 09:35:24 +0000 (05:35 -0400)
commit3d973b2e9a625996ee997c7303cd793b9d197c65
tree98fa7f3f92323a8c404b99d22ff34be3d97ad3a4
parentf5f6b95c72f7f8bb46eace8c5306c752d0133daa
virtio-blk: improve virtqueue error to BLK_STS

Let's change the mapping between virtqueue_add errors to BLK_STS
statuses, so that -ENOSPC, which indicates virtqueue full is still
mapped to BLK_STS_DEV_RESOURCE, but -ENOMEM which indicates non-device
specific resource outage is mapped to BLK_STS_RESOURCE.

Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Link: https://lore.kernel.org/r/20200213123728.61216-3-pasic@linux.ibm.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
drivers/block/virtio_blk.c