From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjTj2-000569-SQ for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:09:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjTiy-0001xW-U2 for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:09:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjTiy-0001wt-7j for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:09:52 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6KA9oBk012600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Jul 2011 06:09:50 -0400 From: Gerd Hoffmann Date: Wed, 20 Jul 2011 12:09:31 +0200 Message-Id: <1311156579-9814-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1311156579-9814-1-git-send-email-kraxel@redhat.com> References: <1311156579-9814-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 1/9] vmstate: add no_migrate flag to VMStateDescription List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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..df6ca65 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -324,6 +324,7 @@ typedef struct VMStateSubsection { struct VMStateDescription { const char *name; + int unmigratable; int version_id; int minimum_version_id; int minimum_version_id_old; diff --git a/savevm.c b/savevm.c index 8139bc7..1c5abe2 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->unmigratable; if (dev && dev->parent_bus && dev->parent_bus->info->get_dev_path) { char *id = dev->parent_bus->info->get_dev_path(dev); -- 1.7.1