From patchwork Tue Oct 11 10:00:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 118925 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 B0F6DB6F18 for ; Tue, 11 Oct 2011 21:50:22 +1100 (EST) Received: from localhost ([::1]:55297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZuc-0008Ue-1w for incoming@patchwork.ozlabs.org; Tue, 11 Oct 2011 06:50:18 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZAf-0002O4-UT for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:02:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDZAe-0008UH-TK for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:02:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZAe-0008UB-J2 for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:02:48 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9BA2lGf026515 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 11 Oct 2011 06:02:48 -0400 Received: from neno.neno (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9BA1lvq021320; Tue, 11 Oct 2011 06:02:41 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 11 Oct 2011 12:00:29 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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/36] 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. Signed-off-by: Juan Quintela --- migration.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/migration.c b/migration.c index 7ac1fc2..090c925 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));