From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCmWR-0004yk-MD for qemu-devel@nongnu.org; Mon, 10 Feb 2014 03:47:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCmWL-00029H-Mf for qemu-devel@nongnu.org; Mon, 10 Feb 2014 03:47:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33393) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCmWL-000293-FV for qemu-devel@nongnu.org; Mon, 10 Feb 2014 03:47:17 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1A8lFIi031103 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Feb 2014 03:47:16 -0500 Date: Mon, 10 Feb 2014 16:47:22 +0800 From: Fam Zheng Message-ID: <20140210084722.GU15707@T430.nay.redhat.com> References: <1391939335-31580-1-git-send-email-pbonzini@redhat.com> <1391939335-31580-20-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1391939335-31580-20-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 19/20] block: do not abuse EMEDIUMTYPE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, mreitz@redhat.com On Sun, 02/09 10:48, Paolo Bonzini wrote: > diff --git a/block/bochs.c b/block/bochs.c > index 51d9a90..f0f9a7e 100644 > --- a/block/bochs.c > +++ b/block/bochs.c > @@ -129,7 +129,8 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags, > strcmp(bochs.subtype, GROWING_TYPE) || > ((le32_to_cpu(bochs.version) != HEADER_VERSION) && > (le32_to_cpu(bochs.version) != HEADER_V1))) { > - return -EMEDIUMTYPE; > + error_setg(errp, "invalid Bochs image header\n"); Ending "\n" is not necessary, including all following cases. > + return -EINVAL; > } > > if (le32_to_cpu(bochs.version) == HEADER_V1) { > diff --git a/block/qcow2.c b/block/qcow2.c > index 2da62b8..fa63d37 100644 > --- a/block/qcow2.c > +++ b/block/qcow2.c > @@ -449,7 +449,7 @@ static int qcow2_open(BlockDriverState *bs, QDict *options, int flags, > > if (header.magic != QCOW_MAGIC) { > error_setg(errp, "Image is not in qcow2 format"); It might be good to have a consistent message pattern in qcow2 as others. Is it worth adding a QERR_ error class for unexpected format magic? Fam > - ret = -EMEDIUMTYPE; > + ret = -EINVAL; > goto fail; > } > if (header.version < 2 || header.version > 3) {