aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-02-09 11:13:26 +0100
committerKevin Wolf <kwolf@redhat.com>2011-02-11 14:34:01 +0100
commit64a216f58edc1c6d34b728c618342aae2493241a (patch)
tree68b7205f1e4d3b46308cf0ab96648eff3e603eab /block
parent12597b06082b5880789a8e738b25a2659a58f64f (diff)
qed: Report error for unsupported features
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 <kwolf@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> (cherry picked from commit 10b758e85c9b38b4b370cff81435f6ed26024a26)
Diffstat (limited to 'block')
-rw-r--r--block/qed.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/block/qed.c b/block/qed.c
index 32734486c5..75ae2440ee 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,13 @@ 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 buf[64];
+ snprintf(buf, sizeof(buf), "%" PRIx64,
+ s->header.features & ~QED_FEATURE_MASK);
+ qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
+ bs->device_name, "QED", buf);
+ return -ENOTSUP;
}
if (!qed_is_cluster_size_valid(s->header.cluster_size)) {
return -EINVAL;