From patchwork Tue Sep 20 13:24:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 115540 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 72462B70BE for ; Tue, 20 Sep 2011 23:58:56 +1000 (EST) Received: from localhost ([::1]:37967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R60KQ-0002Dq-It for incoming@patchwork.ozlabs.org; Tue, 20 Sep 2011 09:25:38 -0400 Received: from eggs.gnu.org ([140.186.70.92]:45118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R60Js-0000lO-QI for qemu-devel@nongnu.org; Tue, 20 Sep 2011 09:25:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R60Jr-00057N-I4 for qemu-devel@nongnu.org; Tue, 20 Sep 2011 09:25:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R60Jr-000578-Ap for qemu-devel@nongnu.org; Tue, 20 Sep 2011 09:25:03 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8KDP269022913 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 20 Sep 2011 09:25:02 -0400 Received: from trasno.mitica (ovpn-113-56.phx2.redhat.com [10.3.113.56]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8KDOpQn017005; Tue, 20 Sep 2011 09:25:01 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 20 Sep 2011 15:24:46 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 7/7] migration: qemu_savevm_iterate has three return values 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 We were retrying when there was one error, entering a loop. Signed-off-by: Juan Quintela --- migration.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/migration.c b/migration.c index 7f8928a..0baed23 100644 --- a/migration.c +++ b/migration.c @@ -362,6 +362,7 @@ void migrate_fd_connect(FdMigrationState *s) void migrate_fd_put_ready(void *opaque) { FdMigrationState *s = opaque; + int ret; if (s->state != MIG_STATE_ACTIVE) { DPRINTF("put_ready returning because of non-active state\n"); @@ -369,7 +370,10 @@ void migrate_fd_put_ready(void *opaque) } DPRINTF("iterate\n"); - if (qemu_savevm_state_iterate(s->mon, s->file) == 1) { + ret = qemu_savevm_state_iterate(s->mon, s->file); + if (ret == -1) { + migrate_fd_error(s); + } else if (ret == 1) { int old_vm_running = vm_running; DPRINTF("done iterating\n");