From patchwork Fri Sep 23 12:50:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 116084 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 1BBD3B6F80 for ; Sat, 24 Sep 2011 00:12:53 +1000 (EST) Received: from localhost ([::1]:48848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R75Ej-0007AJ-7Z for incoming@patchwork.ozlabs.org; Fri, 23 Sep 2011 08:52:13 -0400 Received: from eggs.gnu.org ([140.186.70.92]:38473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R75E4-0005lI-0o for qemu-devel@nongnu.org; Fri, 23 Sep 2011 08:51:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R75Dz-0003Lq-WD for qemu-devel@nongnu.org; Fri, 23 Sep 2011 08:51:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R75Dz-0003Le-Jq for qemu-devel@nongnu.org; Fri, 23 Sep 2011 08:51:27 -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 p8NCpQ5T013762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 23 Sep 2011 08:51:26 -0400 Received: from neno.neno (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8NCpBpl018512; Fri, 23 Sep 2011 08:51:25 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 23 Sep 2011 14:50:45 +0200 Message-Id: <28d7c0af10d91b0428ef81f4e48d3e641d3dc99c.1316781876.git.quintela@redhat.com> 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 09/11] migration: don't "write" when migration is not active 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 If migration is not active, just ignore writes. [Based on Daniel Berrange suggestion] Signed-off-by: Juan Quintela --- migration.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/migration.c b/migration.c index 0b284ff..755b96b 100644 --- a/migration.c +++ b/migration.c @@ -323,6 +323,10 @@ ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size) FdMigrationState *s = opaque; ssize_t ret; + if (s->state != MIG_STATE_ACTIVE) { + return -EIO; + } + do { ret = s->write(s, data, size); } while (ret == -1 && ((s->get_error(s)) == EINTR));