[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 03/15] sheepdog: Fix error handling sd_create()
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v2 03/15] sheepdog: Fix error handling sd_create() |
Date: |
Mon, 6 Mar 2017 20:00:37 +0100 |
As a bdrv_create() method, sd_create() must set an error and return
negative errno on failure. It prints the error instead of setting it
when connect_to_sdog() fails. Fix that.
While there, return the value of connect_to_sdog() like we do
elsewhere, instead of -EIO. No functional change, as
connect_to_sdog() returns no other error code.
Many more suspicious uses of error_report() and error_report_err()
remain in other functions. Left for another day.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
---
block/sheepdog.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 0a0803e..be3db1f 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -1829,14 +1829,12 @@ static int sd_create(const char *filename, QemuOpts
*opts,
if (s->inode.block_size_shift == 0) {
SheepdogVdiReq hdr;
SheepdogClusterRsp *rsp = (SheepdogClusterRsp *)&hdr;
- Error *local_err = NULL;
int fd;
unsigned int wlen = 0, rlen = 0;
- fd = connect_to_sdog(s, &local_err);
+ fd = connect_to_sdog(s, errp);
if (fd < 0) {
- error_report_err(local_err);
- ret = -EIO;
+ ret = fd;
goto out;
}
--
2.7.4
- [Qemu-devel] [PATCH v2 00/15] block: A bunch of fixes for Sheepdog and Gluster, Markus Armbruster, 2017/03/06
- [Qemu-devel] [PATCH v2 04/15] sheepdog: Mark sd_snapshot_delete() lossage FIXME, Markus Armbruster, 2017/03/06
- [Qemu-devel] [PATCH v2 06/15] sheepdog: Don't truncate long VDI name in _open(), _create(), Markus Armbruster, 2017/03/06
- [Qemu-devel] [PATCH v2 03/15] sheepdog: Fix error handling sd_create(),
Markus Armbruster <=
- [Qemu-devel] [PATCH v2 01/15] sheepdog: Defuse time bomb in sd_open() error handling, Markus Armbruster, 2017/03/06
- [Qemu-devel] [PATCH v2 10/15] gluster: Drop assumptions on SocketTransport names, Markus Armbruster, 2017/03/06
- [Qemu-devel] [PATCH v2 05/15] sheepdog: Fix snapshot ID parsing in _open(), _create, _goto(), Markus Armbruster, 2017/03/06
- [Qemu-devel] [PATCH v2 15/15] sheepdog: Support blockdev-add, Markus Armbruster, 2017/03/06
- [Qemu-devel] [PATCH v2 12/15] gluster: Plug memory leaks in qemu_gluster_parse_json(), Markus Armbruster, 2017/03/06
- [Qemu-devel] [PATCH v2 08/15] sheepdog: Use SocketAddress and socket_connect(), Markus Armbruster, 2017/03/06
- [Qemu-devel] [PATCH v2 07/15] sheepdog: Report errors in pseudo-filename more usefully, Markus Armbruster, 2017/03/06
- [Qemu-devel] [PATCH v2 02/15] sheepdog: Fix error handling in sd_snapshot_delete(), Markus Armbruster, 2017/03/06