From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgaOs-00006C-OA for qemu-devel@nongnu.org; Thu, 06 Dec 2012 07:18:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgaOj-0007vg-93 for qemu-devel@nongnu.org; Thu, 06 Dec 2012 07:17:58 -0500 Message-ID: <50C08D19.1030109@redhat.com> Date: Thu, 06 Dec 2012 14:18:33 +0200 From: Orit Wasserman MIME-Version: 1.0 References: <1354795349-2613-1-git-send-email-alevy@redhat.com> <1354795700-3052-1-git-send-email-alevy@redhat.com> In-Reply-To: <1354795700-3052-1-git-send-email-alevy@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] arch_init/ram_load: add error message for block length mismatch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alon Levy Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org On 12/06/2012 02:08 PM, Alon Levy wrote: > Signed-off-by: Alon Levy > --- > Please ignore previous version, accidentally removed goto done and used wrong > format size specifiers. missed that too, but I'm adding better error messages anyway :) > > arch_init.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch_init.c b/arch_init.c > index e6effe8..fba24f3 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -808,6 +808,9 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) > QLIST_FOREACH(block, &ram_list.blocks, next) { > if (!strncmp(id, block->idstr, sizeof(id))) { > if (block->length != length) { > + fprintf(stderr, "Length mismatch: %s: %ld " > + "in != %ld\n", id, length, > + block->length); > ret = -EINVAL; > goto done; > } >