aboutsummaryrefslogtreecommitdiff
path: root/block/vmdk.c
diff options
context:
space:
mode:
authorAshijeet Acharya <ashijeetacharya@gmail.com>2017-01-16 17:01:53 +0530
committerDr. David Alan Gilbert <dgilbert@redhat.com>2017-01-24 18:00:30 +0000
commitfe44dc91807eca59d0230fe828c1e2ee0c305a1e (patch)
treeecbc1e1fd3a3052910eff44f0f6e8a84b626b199 /block/vmdk.c
parenta3a3d8c73889282eb696535f1b5345d88b4dc58c (diff)
downloadqemu-fe44dc91807eca59d0230fe828c1e2ee0c305a1e.zip
qemu-fe44dc91807eca59d0230fe828c1e2ee0c305a1e.tar.gz
qemu-fe44dc91807eca59d0230fe828c1e2ee0c305a1e.tar.bz2
migration: disallow migrate_add_blocker during migration
If a migration is already in progress and somebody attempts to add a migration blocker, this should rightly fail. Add an errp parameter and a retcode return value to migrate_add_blocker. Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com> Message-Id: <1484566314-3987-5-git-send-email-ashijeetacharya@gmail.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: Greg Kurz <groug@kaod.org> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Merged with recent 'Allow invtsc migration' change
Diffstat (limited to 'block/vmdk.c')
-rw-r--r--block/vmdk.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index a11c27a..7750212 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -941,6 +941,7 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
int ret;
BDRVVmdkState *s = bs->opaque;
uint32_t magic;
+ Error *local_err = NULL;
buf = vmdk_read_desc(bs->file, 0, errp);
if (!buf) {
@@ -976,7 +977,13 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
error_setg(&s->migration_blocker, "The vmdk format used by node '%s' "
"does not support live migration",
bdrv_get_device_or_node_name(bs));
- migrate_add_blocker(s->migration_blocker);
+ ret = migrate_add_blocker(s->migration_blocker, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ error_free(s->migration_blocker);
+ goto fail;
+ }
+
g_free(buf);
return 0;