[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/54] curl: correctly propagate errors
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 20/54] curl: correctly propagate errors |
Date: |
Fri, 21 Feb 2014 23:12:17 +0100 |
From: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/curl.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/block/curl.c b/block/curl.c
index bb1fc4a..3494c6d 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -456,30 +456,27 @@ static int curl_open(BlockDriverState *bs, QDict
*options, int flags,
static int inited = 0;
if (flags & BDRV_O_RDWR) {
- qerror_report(ERROR_CLASS_GENERIC_ERROR,
- "curl block device does not support writes");
+ error_setg(errp, "curl block device does not support writes");
return -EROFS;
}
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
qemu_opts_absorb_qdict(opts, options, &local_err);
if (local_err) {
- qerror_report_err(local_err);
- error_free(local_err);
+ error_propagate(errp, local_err);
goto out_noclean;
}
s->readahead_size = qemu_opt_get_size(opts, "readahead", READ_AHEAD_SIZE);
if ((s->readahead_size & 0x1ff) != 0) {
- fprintf(stderr, "HTTP_READAHEAD_SIZE %zd is not a multiple of 512\n",
- s->readahead_size);
+ error_setg(errp, "HTTP_READAHEAD_SIZE %zd is not a multiple of 512",
+ s->readahead_size);
goto out_noclean;
}
file = qemu_opt_get(opts, "url");
if (file == NULL) {
- qerror_report(ERROR_CLASS_GENERIC_ERROR, "curl block driver requires "
- "an 'url' option");
+ error_setg(errp, "curl block driver requires an 'url' option");
goto out_noclean;
}
--
1.8.1.4
- [Qemu-devel] [PULL 10/54] block: Remove bdrv_open_image()'s force_raw option, (continued)
- [Qemu-devel] [PULL 10/54] block: Remove bdrv_open_image()'s force_raw option, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 11/54] nbd: produce a better error if neither host nor port is passed, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 12/54] nbd: correctly propagate errors, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 13/54] nbd: inline tcp_socket_incoming_spec into sole caller, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 14/54] nbd: move socket wrappers to qemu-nbd, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 15/54] iscsi: fix indentation, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 16/54] iscsi: correctly propagate errors in iscsi_open, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 17/54] gluster: default scheme to gluster:// and host to localhost., Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 19/54] cow: correctly propagate errors, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 18/54] gluster: correctly propagate errors, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 20/54] curl: correctly propagate errors,
Kevin Wolf <=
- [Qemu-devel] [PULL 21/54] qcow: correctly propagate errors, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 22/54] qed: correctly propagate errors, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 23/54] vhdx: correctly propagate errors, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 25/54] vmdk: extract vmdk_read_desc, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 26/54] vmdk: push vmdk_read_desc up to caller, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 24/54] vvfat: correctly propagate errors, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 27/54] vmdk: do not try opening a file as both image and descriptor, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 28/54] vmdk: correctly propagate errors, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 29/54] block: do not abuse EMEDIUMTYPE, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 30/54] vdi: say why an image is bad, Kevin Wolf, 2014/02/21