[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/12] block/raw-posix: Fix ret in raw_open_common()
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH 12/12] block/raw-posix: Fix ret in raw_open_common() |
Date: |
Tue, 25 Nov 2014 15:08:05 +0100 |
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: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/raw-posix.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index b1af77e..96491fc 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;
}
--
1.9.3
- [Qemu-devel] [PATCH 01/12] block: qcow2 driver may not be found, (continued)
- [Qemu-devel] [PATCH 01/12] block: qcow2 driver may not be found, Max Reitz, 2014/11/25
- [Qemu-devel] [PATCH 04/12] block: Check create_opts before image creation, Max Reitz, 2014/11/25
- [Qemu-devel] [PATCH 05/12] qemu-img: Check create_opts before image creation, Max Reitz, 2014/11/25
- [Qemu-devel] [PATCH 06/12] qemu-img: Check create_opts before image amendment, Max Reitz, 2014/11/25
- [Qemu-devel] [PATCH 08/12] iotests: Add test for unsupported image creation, Max Reitz, 2014/11/25
- [Qemu-devel] [PATCH 07/12] iotests: Only kill NBD server if it runs, Max Reitz, 2014/11/25
- [Qemu-devel] [PATCH 09/12] qcow2: Prevent numerical overflow, Max Reitz, 2014/11/25
- [Qemu-devel] [PATCH 10/12] qcow2: Flushing the caches in qcow2_close may fail, Max Reitz, 2014/11/25
- [Qemu-devel] [PATCH 12/12] block/raw-posix: Fix ret in raw_open_common(),
Max Reitz <=
- [Qemu-devel] [PATCH 11/12] qcow2: Respect bdrv_truncate() error, Max Reitz, 2014/11/25