[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/16] convert fprintf() calls to error_setg() in blo
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 09/16] convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create() |
Date: |
Wed, 23 Apr 2014 12:04:44 +0200 |
From: Aakriti Gupta <address@hidden>
This patch converts fprintf() calls to error_setg() in
block/qed.c:bdrv_qed_create()
(error_setg() is part of error reporting API in include/qapi/error.h)
Signed-off-by: Aakriti Gupta <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qed.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/block/qed.c b/block/qed.c
index 3bd9db9..c130e42 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -650,19 +650,21 @@ static int bdrv_qed_create(const char *filename,
QEMUOptionParameter *options,
}
if (!qed_is_cluster_size_valid(cluster_size)) {
- fprintf(stderr, "QED cluster size must be within range [%u, %u] and
power of 2\n",
- QED_MIN_CLUSTER_SIZE, QED_MAX_CLUSTER_SIZE);
+ error_setg(errp, "QED cluster size must be within range [%u, %u] "
+ "and power of 2",
+ QED_MIN_CLUSTER_SIZE, QED_MAX_CLUSTER_SIZE);
return -EINVAL;
}
if (!qed_is_table_size_valid(table_size)) {
- fprintf(stderr, "QED table size must be within range [%u, %u] and
power of 2\n",
- QED_MIN_TABLE_SIZE, QED_MAX_TABLE_SIZE);
+ error_setg(errp, "QED table size must be within range [%u, %u] "
+ "and power of 2",
+ QED_MIN_TABLE_SIZE, QED_MAX_TABLE_SIZE);
return -EINVAL;
}
if (!qed_is_image_size_valid(image_size, cluster_size, table_size)) {
- fprintf(stderr, "QED image size must be a non-zero multiple of "
- "cluster size and less than %" PRIu64 " bytes\n",
- qed_max_image_size(cluster_size, table_size));
+ error_setg(errp, "QED image size must be a non-zero multiple of "
+ "cluster size and less than %" PRIu64 " bytes",
+ qed_max_image_size(cluster_size, table_size));
return -EINVAL;
}
--
1.8.3.1
- [Qemu-devel] [PULL 13/16] qemu-iotests: Check common namespace for id and node-name, (continued)
- [Qemu-devel] [PULL 13/16] qemu-iotests: Check common namespace for id and node-name, Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 10/16] block: Add errp to bdrv_new(), Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 12/16] block: Catch duplicate IDs in bdrv_new(), Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 14/16] qemu-img: Improve error messages, Kevin Wolf, 2014/04/23
- Re: [Qemu-devel] [PULL 14/16] qemu-img: Improve error messages, Jeff Cody, 2014/04/25
- Re: [Qemu-devel] [PULL 14/16] qemu-img: Improve error messages, Markus Armbruster, 2014/04/25
- Re: [Qemu-devel] [PULL 14/16] qemu-img: Improve error messages, Fam Zheng, 2014/04/27
- Re: [Qemu-devel] [PULL 14/16] qemu-img: Improve error messages, Mike Day, 2014/04/30
- Re: [Qemu-devel] [PULL 14/16] qemu-img: Improve error messages, Eric Blake, 2014/04/30
- Re: [Qemu-devel] [PULL 14/16] qemu-img: Improve error messages, Mike Day, 2014/04/30
[Qemu-devel] [PULL 09/16] convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create(),
Kevin Wolf <=
[Qemu-devel] [PULL 08/16] block: Remove -errno return value from bdrv_assign_node_name, Kevin Wolf, 2014/04/23
[Qemu-devel] [PULL 15/16] vmdk: Fix "%x" to PRIx32 in format strings for cid, Kevin Wolf, 2014/04/23
[Qemu-devel] [PULL 16/16] block/cloop: use PRIu32 format specifier for uint32_t, Kevin Wolf, 2014/04/23
[Qemu-devel] [PULL 06/16] block: Handle error of bdrv_getlength in bdrv_create_dirty_bitmap, Kevin Wolf, 2014/04/23
Re: [Qemu-devel] [PULL 00/16] Block patches, Peter Maydell, 2014/04/25