summaryrefslogtreecommitdiffstats
path: root/nbd
diff options
context:
space:
mode:
authorEric Blake2016-05-12 00:39:43 +0200
committerPaolo Bonzini2016-06-16 18:39:05 +0200
commitf3c32fce3688fe1f13ceb0777faa1fc19d66d1fc (patch)
tree6a4bd762166ec0f04b4d214d44d2e6f0bddfa1d6 /nbd
parentnbd: Clean up ioctl handling of qemu-nbd -c (diff)
downloadqemu-f3c32fce3688fe1f13ceb0777faa1fc19d66d1fc.tar.gz
qemu-f3c32fce3688fe1f13ceb0777faa1fc19d66d1fc.tar.xz
qemu-f3c32fce3688fe1f13ceb0777faa1fc19d66d1fc.zip
nbd: Detect servers that send unexpected error values
Add some debugging to flag servers that are not compliant to the NBD protocol. This would have flagged the server bug fixed in commit c0301fcc. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Alex Bligh <alex@alex.org.uk> Message-Id: <1463006384-7734-11-git-send-email-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'nbd')
-rw-r--r--nbd/client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nbd/client.c b/nbd/client.c
index 20e6daf70f..e8bf9fb540 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -33,8 +33,10 @@ static int nbd_errno_to_system_errno(int err)
return ENOMEM;
case NBD_ENOSPC:
return ENOSPC;
- case NBD_EINVAL:
default:
+ TRACE("Squashing unexpected error %d to EINVAL", err);
+ /* fallthrough */
+ case NBD_EINVAL:
return EINVAL;
}
}