diff options
author | Jeff Cody <jcody@redhat.com> | 2017-11-07 08:10:35 -0500 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2017-11-14 18:06:26 +0100 |
commit | 1d0f37cf210ae224b98c612981e4df83120b2f0b (patch) | |
tree | d22775593fae648c41b005c3305cf0ae2e3af11f /block/parallels.c | |
parent | 6c7d390b993c4bbadd51ceeb41f7d2fdd68cb4fd (diff) |
block/parallels: add migration blocker
Migration does not work for parallels, and has been broken for a while
(see patch 'block/parallels: Do not update header or truncate image when
INMIGRATE'). The bdrv_invalidate_cache() method needs to be added for
migration to be supported. Until this is done, prohibit migration.
Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 5e04a7c8a3089913fa58d484af42dab7993984ad.1510059970.git.jcody@redhat.com
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/parallels.c')
-rw-r--r-- | block/parallels.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/block/parallels.c b/block/parallels.c index 7b7a3efa1d..9545761f49 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -35,6 +35,7 @@ #include "qemu/module.h" #include "qemu/bswap.h" #include "qemu/bitmap.h" +#include "migration/blocker.h" /**************************************************************/ @@ -100,6 +101,7 @@ typedef struct BDRVParallelsState { unsigned int tracks; unsigned int off_multiplier; + Error *migration_blocker; } BDRVParallelsState; @@ -720,6 +722,16 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags, s->bat_dirty_bmap = bitmap_new(DIV_ROUND_UP(s->header_size, s->bat_dirty_block)); + /* Disable migration until bdrv_invalidate_cache method is added */ + error_setg(&s->migration_blocker, "The Parallels format used by node '%s' " + "does not support live migration", + bdrv_get_device_or_node_name(bs)); + ret = migrate_add_blocker(s->migration_blocker, &local_err); + if (local_err) { + error_propagate(errp, local_err); + error_free(s->migration_blocker); + goto fail; + } qemu_co_mutex_init(&s->lock); return 0; @@ -750,6 +762,9 @@ static void parallels_close(BlockDriverState *bs) g_free(s->bat_dirty_bmap); qemu_vfree(s->header); + + migrate_del_blocker(s->migration_blocker); + error_free(s->migration_blocker); } static QemuOptsList parallels_create_opts = { |