From patchwork Thu Aug 20 17:42:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 31754 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id BEB83B7B60 for ; Fri, 21 Aug 2009 03:53:46 +1000 (EST) Received: from localhost ([127.0.0.1]:51597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeBpY-0002D0-08 for incoming@patchwork.ozlabs.org; Thu, 20 Aug 2009 13:53:44 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeBhF-0006Ds-Uo for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:45:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeBhA-0006A1-Qd for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:45:09 -0400 Received: from [199.232.76.173] (port=39143 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeBhA-00069s-KB for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:45:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1249) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MeBhA-0006we-42 for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:45:04 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7KHj2oD005852 for ; Thu, 20 Aug 2009 13:45:02 -0400 Received: from localhost.localdomain (vpn2-8-130.ams2.redhat.com [10.36.8.130]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7KHis4Q012471; Thu, 20 Aug 2009 13:45:01 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 20 Aug 2009 19:42:23 +0200 Message-Id: <1625967157e355a3312b64265b026fdce7087cb2.1250788880.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 05/23] Use return value from load_state() call back X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela --- savevm.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/savevm.c b/savevm.c index 4868285..ffa68da 100644 --- a/savevm.c +++ b/savevm.c @@ -955,7 +955,12 @@ int qemu_loadvm_state(QEMUFile *f) le->next = first_le; first_le = le; - le->se->load_state(f, le->se->opaque, le->version_id); + ret = le->se->load_state(f, le->se->opaque, le->version_id); + if (ret < 0) { + fprintf(stderr, "qemu: warning: error while loading state for instance 0x%x of device '%s'\n", + instance_id, idstr); + goto out; + } break; case QEMU_VM_SECTION_PART: case QEMU_VM_SECTION_END: @@ -968,7 +973,12 @@ int qemu_loadvm_state(QEMUFile *f) goto out; } - le->se->load_state(f, le->se->opaque, le->version_id); + ret = le->se->load_state(f, le->se->opaque, le->version_id); + if (ret < 0) { + fprintf(stderr, "qemu: warning: error while loading state section id %d\n", + section_id); + goto out; + } break; default: fprintf(stderr, "Unknown savevm section type %d\n", section_type);