[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 16/37] block: Save errno before error_setg_errno
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 16/37] block: Save errno before error_setg_errno |
Date: |
Fri, 8 Nov 2013 11:12:10 +0100 |
From: Max Reitz <address@hidden>
error_setg_errno() may overwrite errno; therefore, its value should be
read before calling that function and not afterwards.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 58efb5b..0e96a22 100644
--- a/block.c
+++ b/block.c
@@ -1084,8 +1084,8 @@ int bdrv_open(BlockDriverState *bs, const char *filename,
QDict *options,
snprintf(backing_filename, sizeof(backing_filename),
"%s", filename);
} else if (!realpath(filename, backing_filename)) {
- error_setg_errno(errp, errno, "Could not resolve path '%s'",
filename);
ret = -errno;
+ error_setg_errno(errp, errno, "Could not resolve path '%s'",
filename);
goto fail;
}
--
1.8.3.1
- [Qemu-devel] [PULL v2 00/37] Block patches, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 01/37] qapi: Fix comment for create-type to match code., Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 04/37] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 05/37] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 06/37] block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 09/37] block: qemu-iotests, add quotes to $TEST_IMG usage for 051, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 12/37] libqtest: rename qmp() to qmp_discard_response(), Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 13/37] libqtest: add qmp(fmt, ...) -> QDict* function, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 16/37] block: Save errno before error_setg_errno,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v2 14/37] blockdev-test: add test case for drive_add duplicate IDs, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 17/37] block/vpc: fix virtual size for images created with disk2vhd, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 18/37] block: vhdx - minor comments and typo correction., Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 20/37] block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header., Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 24/37] block: vhdx code movement - move vhdx_close() above vhdx_open(), Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 25/37] block: vhdx - log parsing, replay, and flush support, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 27/37] block: vhdx - add log write support, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 02/37] qemu-iotests: Filter out actual image size in 067, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 29/37] block: vhdx - remove BAT file offset bit shifting, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 30/37] block: vhdx - move more endian translations to vhdx-endian.c, Stefan Hajnoczi, 2013/11/08