diff options
author | Max Reitz <mreitz@redhat.com> | 2014-12-02 18:32:53 +0100 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2015-02-22 12:10:01 -0600 |
commit | 6950b92765595fe3255f6127a517c3866c5df4bd (patch) | |
tree | db3b4a4a3d9be354bf97bbc0f8125c7cdedce9f6 | |
parent | 9b3f3d6da97727576b36958fa60f0b0faffb334a (diff) | |
download | qemu-6950b92765595fe3255f6127a517c3866c5df4bd.tar.gz |
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 <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 01212d4ed68fc8daa29062a9a38650cf8febe392)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | block/raw-posix.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c index d8bbed0676..ef21242891 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -446,6 +446,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options, } if (fstat(s->fd, &st) < 0) { + ret = -errno; error_setg_errno(errp, errno, "Could not stat file"); goto fail; } |