提交 10b758e8 编写于 作者: K Kevin Wolf

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: NKevin Wolf <kwolf@redhat.com>
Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
Acked-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
上级 e8cdcec1
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册