From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSswg-0005Qe-Vk for qemu-devel@nongnu.org; Tue, 22 Nov 2011 11:11:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSswc-0007mk-TX for qemu-devel@nongnu.org; Tue, 22 Nov 2011 11:11:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSswc-0007mZ-K6 for qemu-devel@nongnu.org; Tue, 22 Nov 2011 11:11:38 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAMGBcl6001042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 22 Nov 2011 11:11:38 -0500 From: Kevin Wolf Date: Tue, 22 Nov 2011 17:14:42 +0100 Message-Id: <1321978482-4609-6-git-send-email-kwolf@redhat.com> In-Reply-To: <1321978482-4609-1-git-send-email-kwolf@redhat.com> References: <1321978482-4609-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 5/5] vvfat: Add migration blocker List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com vvfat caches more or less everything when in writable mode. For migration to work, it would have to be invalidated. Block migration for now when in writable mode (default is readonly). Signed-off-by: Kevin Wolf --- block/vvfat.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index 131680f..a310ce8 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -27,6 +27,7 @@ #include "qemu-common.h" #include "block_int.h" #include "module.h" +#include "migration.h" #ifndef S_IWGRP #define S_IWGRP 0 @@ -350,6 +351,8 @@ typedef struct BDRVVVFATState { array_t commits; const char* path; int downcase_short_names; + + Error *migration_blocker; } BDRVVVFATState; /* take the sector position spos and convert it to Cylinder/Head/Sector position @@ -1073,6 +1076,15 @@ DLOG(if (stderr == NULL) { // assert(is_consistent(s)); qemu_co_mutex_init(&s->lock); + + /* Disable migration when vvfat is used rw */ + if (s->qcow) { + error_set(&s->migration_blocker, + QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED, + "vvfat (rw)", bs->device_name, "live migration"); + migrate_add_blocker(s->migration_blocker); + } + return 0; } @@ -2829,6 +2841,11 @@ static void vvfat_close(BlockDriverState *bs) array_free(&(s->directory)); array_free(&(s->mapping)); g_free(s->cluster_buffer); + + if (s->qcow) { + migrate_del_blocker(s->migration_blocker); + error_free(s->migration_blocker); + } } static BlockDriver bdrv_vvfat = { -- 1.7.6.4