From patchwork Fri Jul 8 08:53:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 103787 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 749691007D1 for ; Fri, 8 Jul 2011 19:08:08 +1000 (EST) Received: from localhost ([::1]:33075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf72a-0001tS-BI for incoming@patchwork.ozlabs.org; Fri, 08 Jul 2011 05:08:04 -0400 Received: from eggs.gnu.org ([140.186.70.92]:55265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf6pB-0007rv-Bf for qemu-devel@nongnu.org; Fri, 08 Jul 2011 04:54:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qf6p1-0001Ec-I0 for qemu-devel@nongnu.org; Fri, 08 Jul 2011 04:54:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf6p1-0001EK-0r for qemu-devel@nongnu.org; Fri, 08 Jul 2011 04:54: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 p688s1oe023005 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 8 Jul 2011 04:54:02 -0400 Received: from rincewind.home.kraxel.org (vpn1-4-42.ams2.redhat.com [10.36.4.42]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p688s06c015992; Fri, 8 Jul 2011 04:54:01 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 9950240AC7; Fri, 8 Jul 2011 10:53:59 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 8 Jul 2011 10:53:57 +0200 Message-Id: <1310115239-19288-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1310115239-19288-1-git-send-email-kraxel@redhat.com> References: <1310115239-19288-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 1/3] vmstate: add no_migrate flag to VMStateDescription 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 This allows to easily tag devices as non-migratable, so any attempt to migrate a virtual machine with the device in question active will make migration fail. Signed-off-by: Gerd Hoffmann --- hw/hw.h | 1 + savevm.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 9dd7096..1eb3486 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -324,6 +324,7 @@ typedef struct VMStateSubsection { struct VMStateDescription { const char *name; + int no_migrate; int version_id; int minimum_version_id; int minimum_version_id_old; diff --git a/savevm.c b/savevm.c index 8139bc7..fa2da3e 100644 --- a/savevm.c +++ b/savevm.c @@ -1234,6 +1234,7 @@ int vmstate_register_with_alias_id(DeviceState *dev, int instance_id, se->opaque = opaque; se->vmsd = vmsd; se->alias_id = alias_id; + se->no_migrate = vmsd->no_migrate; if (dev && dev->parent_bus && dev->parent_bus->info->get_dev_path) { char *id = dev->parent_bus->info->get_dev_path(dev);