[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/4] qed: Report error for unsupported features
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 3/4] qed: Report error for unsupported features |
Date: |
Wed, 9 Feb 2011 11:32:00 +0100 |
Instead of just returning -ENOTSUP, generate a more detailed error.
Unfortunately we don't have a helpful text for features that we don't know yet,
so just print the feature mask. It might be useful at least if someone asks for
help.
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qed.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/block/qed.c b/block/qed.c
index 3273448..8b0a975 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -14,6 +14,7 @@
#include "trace.h"
#include "qed.h"
+#include "qerror.h"
static void qed_aio_cancel(BlockDriverAIOCB *blockacb)
{
@@ -311,7 +312,12 @@ static int bdrv_qed_open(BlockDriverState *bs, int flags)
return -EINVAL;
}
if (s->header.features & ~QED_FEATURE_MASK) {
- return -ENOTSUP; /* image uses unsupported feature bits */
+ /* image uses unsupported feature bits */
+ char version[64];
+ snprintf(version, sizeof(version), "%" PRIx64, s->header.features);
+ qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
+ bs->device_name, version);
+ return -ENOTSUP;
}
if (!qed_is_cluster_size_valid(s->header.cluster_size)) {
return -EINVAL;
--
1.7.2.3
[Qemu-devel] [PATCH 4/4] qemu-img: Improve error messages for failed bdrv_open, Kevin Wolf, 2011/02/09