From 6bbb939a8061d189bf29aa2b3ef1a5717380f41a Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Tue, 2 Dec 2014 18:32:53 +0100 Subject: block/raw-posix: Fix ret in raw_open_common() The return value must be negative on error; there is one place in raw_open_common() where errp is set, but ret remains 0. Fix it. Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf (cherry picked from commit 01212d4ed68fc8daa29062a9a38650cf8febe392) Signed-off-by: Michael Roth --- block/raw-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index 2d51f2635c..efa56869a1 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -447,6 +447,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options, s->has_write_zeroes = true; if (fstat(s->fd, &st) < 0) { + ret = -errno; error_setg_errno(errp, errno, "Could not stat file"); goto fail; } -- cgit v1.2.1