From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYDzB-0006HR-3y for qemu-devel@nongnu.org; Fri, 03 May 2013 07:17:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYDz9-0006DH-TB for qemu-devel@nongnu.org; Fri, 03 May 2013 07:17:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYDz9-0006D3-MB for qemu-devel@nongnu.org; Fri, 03 May 2013 07:17:07 -0400 Date: Fri, 3 May 2013 13:17:01 +0200 From: Kevin Wolf Message-ID: <20130503111701.GG3171@dhcp-200-207.str.redhat.com> References: <291f8782cd40a200837caac08c7fbeb5c03a0f78.1366817130.git.phrdina@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <291f8782cd40a200837caac08c7fbeb5c03a0f78.1366817130.git.phrdina@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 07/12] savevm: update error reporting for qemu_loadvm_state() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Hrdina Cc: xiawenc@linux.vnet.ibm.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com Am 24.04.2013 um 17:32 hat Pavel Hrdina geschrieben: > Signed-off-by: Pavel Hrdina > --- > include/sysemu/sysemu.h | 2 +- > migration.c | 11 ++++++--- > savevm.c | 65 ++++++++++++++++++++++++------------------------- > 3 files changed, 40 insertions(+), 38 deletions(-) > @@ -2212,8 +2216,8 @@ int qemu_loadvm_state(QEMUFile *f) > > ret = vmstate_load(f, le->se, 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); > + error_setg(errp, "Error while loading state for instance " > + "0x%x of device '%s'", instance_id, idstr); error_setg_errno? > goto out; > } > break; > @@ -2227,40 +2231,35 @@ int qemu_loadvm_state(QEMUFile *f) > } > } > if (le == NULL) { > - fprintf(stderr, "Unknown savevm section %d\n", section_id); > - ret = -EINVAL; > + error_setg(errp, "Unknown vmstate section %d", section_id); > goto out; > } > > ret = vmstate_load(f, le->se, le->version_id); > if (ret < 0) { > - fprintf(stderr, "qemu: warning: error while loading state section id %d\n", > + error_setg(errp, "Error while loading state section id %d", > section_id); Here, too. > goto out; > } > break; > default: > - fprintf(stderr, "Unknown savevm section type %d\n", section_type); > - ret = -EINVAL; > + error_setg(errp, "Unknown vmstate section type %d", section_type); > goto out; > } > } Kevin