From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48970 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pn874-0003j5-1y for qemu-devel@nongnu.org; Wed, 09 Feb 2011 06:21:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pn872-0007po-Un for qemu-devel@nongnu.org; Wed, 09 Feb 2011 06:21:33 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:55248) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pn872-0007h6-PA for qemu-devel@nongnu.org; Wed, 09 Feb 2011 06:21:32 -0500 Received: by mail-ww0-f53.google.com with SMTP id 18so48192wwi.10 for ; Wed, 09 Feb 2011 03:21:32 -0800 (PST) Message-ID: <4D5278B3.3040604@codemonkey.ws> Date: Wed, 09 Feb 2011 05:21:23 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1297247521-11464-1-git-send-email-kwolf@redhat.com> <1297247521-11464-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1297247521-11464-4-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 3/4] qed: Report error for unsupported features List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: stefanha@gmail.com, qemu-devel@nongnu.org, lcapitulino@redhat.com On 02/09/2011 04:32 AM, Kevin Wolf wrote: > 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 > We can use a compatible feature to create a feature name table. > --- > 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); > It would be useful to do s->header.features & QED_FEATURE_MASK here as a management tool doesn't know what features this version of QED supports. Regards, Anthony Liguori > + 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; >