From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCmER-0002Ef-Gt for qemu-devel@nongnu.org; Mon, 10 Feb 2014 03:28:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCmEL-0005jD-Dh for qemu-devel@nongnu.org; Mon, 10 Feb 2014 03:28:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCmEK-0005j6-S8 for qemu-devel@nongnu.org; Mon, 10 Feb 2014 03:28:41 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1A8SepU024079 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Feb 2014 03:28:40 -0500 Message-ID: <52F88DB3.2010004@redhat.com> Date: Mon, 10 Feb 2014 09:28:35 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1391939335-31580-1-git-send-email-pbonzini@redhat.com> <1391939335-31580-12-git-send-email-pbonzini@redhat.com> <20140210080953.GM15707@T430.nay.redhat.com> In-Reply-To: <20140210080953.GM15707@T430.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 11/20] qcow: correctly propagate errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, mreitz@redhat.com Il 10/02/2014 09:09, Fam Zheng ha scritto: > On Sun, 02/09 10:48, Paolo Bonzini wrote: >> Signed-off-by: Paolo Bonzini >> --- >> block/qcow.c | 16 ++++++---------- >> 1 file changed, 6 insertions(+), 10 deletions(-) >> >> diff --git a/block/qcow.c b/block/qcow.c >> index 948b0c5..23bc691 100644 >> --- a/block/qcow.c >> +++ b/block/qcow.c >> @@ -119,17 +119,19 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags, >> if (header.version != QCOW_VERSION) { >> char version[64]; >> snprintf(version, sizeof(version), "QCOW version %d", header.version); >> - qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE, >> - bs->device_name, "qcow", version); >> + error_set(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE, >> + bs->device_name, "qcow", version); >> ret = -ENOTSUP; >> goto fail; >> } >> >> if (header.size <= 1 || header.cluster_bits < 9) { >> + error_setg(errp, "invalid value in qcow header\n"); > > The convention is not adding "\n" in the end of error messages. > >> ret = -EINVAL; >> goto fail; >> } >> if (header.crypt_method > QCOW_CRYPT_AES) { >> + error_setg(errp, "invalid encryption method in qcow header\n"); > > Same here. Oops, I'll fix all of them. Paolo