Message ID | 5d07b67f40f00586834bfc7e6e3adbfcc058e3de.1510021573.git.jcody@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, Nov 06, 2017 at 09:31:21PM -0500, Jeff Cody wrote: > @@ -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; > + } Please call migrate_del_blocker() and error_free() in .bdrv_close().
diff --git a/block/parallels.c b/block/parallels.c index 7b7a3ef..ffe0a79 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;
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> --- block/parallels.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)