From patchwork Fri Jul 4 17:41:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 367197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BF684140095 for ; Sat, 5 Jul 2014 04:59:50 +1000 (EST) Received: from localhost ([::1]:37733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X38i5-0003FQ-36 for incoming@patchwork.ozlabs.org; Fri, 04 Jul 2014 14:59:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X37VJ-0007m6-Sn for qemu-devel@nongnu.org; Fri, 04 Jul 2014 13:42:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X37VB-0008IM-65 for qemu-devel@nongnu.org; Fri, 04 Jul 2014 13:42:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X37VA-0008I9-UW for qemu-devel@nongnu.org; Fri, 04 Jul 2014 13:42:25 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s64HgMMW017849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Jul 2014 13:42:22 -0400 Received: from dgilbert-t530.home.treblig.org (vpn1-7-141.ams2.redhat.com [10.36.7.141]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s64HfvTg030576; Fri, 4 Jul 2014 13:42:20 -0400 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Fri, 4 Jul 2014 18:41:24 +0100 Message-Id: <1404495717-4239-14-git-send-email-dgilbert@redhat.com> In-Reply-To: <1404495717-4239-1-git-send-email-dgilbert@redhat.com> References: <1404495717-4239-1-git-send-email-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, lilei@linux.vnet.ibm.com, quintela@redhat.com Subject: [Qemu-devel] [PATCH 13/46] qemu_loadvm debug X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Dr. David Alan Gilbert" Add lots of DPRINTF debug in qemu_loadvm* Signed-off-by: Dr. David Alan Gilbert --- savevm.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/savevm.c b/savevm.c index 16b672b..662a910 100644 --- a/savevm.c +++ b/savevm.c @@ -719,6 +719,8 @@ int qemu_savevm_state_iterate(QEMUFile *f) trace_savevm_section_end(se->idstr, se->section_id); if (ret < 0) { + DPRINTF("%s: setting error state after iterate on id=%d/%s", + __func__, se->section_id, se->idstr); qemu_file_set_error(f, ret); } if (ret <= 0) { @@ -1018,6 +1020,7 @@ int qemu_loadvm_state(QEMUFile *f) SaveStateEntry *se; char idstr[256]; + DPRINTF("qemu_loadvm_state loop: section_type=%d", section_type); switch (section_type) { case QEMU_VM_SECTION_START: case QEMU_VM_SECTION_FULL: @@ -1031,6 +1034,9 @@ int qemu_loadvm_state(QEMUFile *f) instance_id = qemu_get_be32(f); version_id = qemu_get_be32(f); + DPRINTF("qemu_loadvm_state loop START/FULL: id=%d(%s)", + section_id, idstr); + /* Find savevm section */ se = find_se(idstr, instance_id); if (se == NULL) { @@ -1058,8 +1064,9 @@ 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_report("qemu: error while loading state for" + "instance 0x%x of device '%s'", + instance_id, idstr); goto out; } break; @@ -1067,23 +1074,25 @@ int qemu_loadvm_state(QEMUFile *f) case QEMU_VM_SECTION_END: section_id = qemu_get_be32(f); + DPRINTF("QEMU_VM_SECTION_PART/END entry for id=%d", section_id); QLIST_FOREACH(le, &loadvm_handlers, entry) { if (le->section_id == section_id) { break; } } if (le == NULL) { - fprintf(stderr, "Unknown savevm section %d\n", section_id); + error_report("Unknown savevm section %d", section_id); ret = -EINVAL; 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", - section_id); + error_report("qemu: error while loading state section" + " id %d (%s)", section_id, le->se->idstr); goto out; } + DPRINTF("QEMU_VM_SECTION_PART/END done for id=%d", section_id); break; case QEMU_VM_COMMAND: ret = loadvm_process_command(f); @@ -1092,11 +1101,12 @@ int qemu_loadvm_state(QEMUFile *f) } break; default: - fprintf(stderr, "Unknown savevm section type %d\n", section_type); + error_report("Unknown savevm section type %d", section_type); ret = -EINVAL; goto out; } } + DPRINTF("qemu_loadvm_state loop: exited loop"); cpu_synchronize_all_post_init(); @@ -1112,6 +1122,7 @@ out: ret = qemu_file_get_error(f); } + DPRINTF("qemu_loadvm_state out: ret=%d", ret); return ret; }