Commit f3c32fce authored by Eric Blake's avatar Eric Blake Committed by Paolo Bonzini
Browse files

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: default avatarEric Blake <eblake@redhat.com>
Reviewed-by: default avatarAlex Bligh <alex@alex.org.uk>

Message-Id: <1463006384-7734-11-git-send-email-eblake@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent f57e2416
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
    }
}