diff options
author | Kevin Wolf <kwolf@redhat.com> | 2011-11-22 16:52:13 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-11-23 17:04:05 +0100 |
commit | 3397f0cb483b40785678d2328da584c8a35c358c (patch) | |
tree | ef6f7ebd8d09852cf863b40149a5451990de8730 /block | |
parent | 612ff3d8876a6df0484aa6ebb5cae4575f7514c5 (diff) | |
download | qemu-3397f0cb483b40785678d2328da584c8a35c358c.zip |
vvfat: Add migration blocker
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 <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/vvfat.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/block/vvfat.c b/block/vvfat.c index 131680f6f4..a310ce8c3e 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 = { |