From: Max Reitz Date: Wed, 25 Feb 2015 18:08:16 +0000 (-0500) Subject: nbd: Fix nbd_establish_connection()'s return value X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2b1f13b996c3a278ed3d4bf4ce0893f3506fb7cc;p=qemu.git nbd: Fix nbd_establish_connection()'s return value unix_connect_opts() and inet_connect_opts() do not necessarily set errno (if at all); therefore, nbd_establish_connection() should not literally return -errno on error. Signed-off-by: Max Reitz Message-Id: <1424887718-10800-4-git-send-email-mreitz@redhat.com> Signed-off-by: Paolo Bonzini --- diff --git a/block/nbd.c b/block/nbd.c index 6634a69664..217618612d 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -248,7 +248,7 @@ static int nbd_establish_connection(BlockDriverState *bs, Error **errp) /* Failed to establish connection */ if (sock < 0) { logout("Failed to establish connection to NBD server\n"); - return -errno; + return -EIO; } return sock;