From 7618674772c3a0cbfa00ec2e9df95e3d96777eeb Mon Sep 17 00:00:00 2001 Message-Id: <7618674772c3a0cbfa00ec2e9df95e3d96777eeb.1378999677.git.minovotn@redhat.com> In-Reply-To: References: From: Jeffrey Cody Date: Thu, 12 Sep 2013 03:10:47 +0200 Subject: [PATCH 4/5] vpc: Add migration blocker RH-Author: Jeffrey Cody Message-id: Patchwork-id: 54302 O-Subject: [RHEL6.5 qemu-kvm PATCH 4/5] vpc: Add migration blocker Bugzilla: 999779 RH-Acked-by: Paolo Bonzini RH-Acked-by: Orit Wasserman RH-Acked-by: Kevin Wolf From: Kevin Wolf vpc caches the BAT. For migration to work, it would have to be invalidated. Block migration for now. Signed-off-by: Kevin Wolf (cherry picked from commit 612ff3d8876a6df0484aa6ebb5cae4575f7514c5) Conflicts: block/vpc.c Signed-off-by: Jeff Cody --- block/vpc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) Signed-off-by: Michal Novotny --- block/vpc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/block/vpc.c b/block/vpc.c index 9d3bbfc..1a01bae 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -28,6 +28,7 @@ #if defined(CONFIG_UUID) #include #endif +#include "migration.h" /**************************************************************/ @@ -131,6 +132,8 @@ typedef struct BDRVVPCState { uint64_t last_bitmap; #endif + + Error *migration_blocker; } BDRVVPCState; static uint32_t vpc_checksum(uint8_t* buf, size_t size) @@ -267,6 +270,13 @@ static int vpc_open(BlockDriverState *bs, int flags) } qemu_co_mutex_init(&s->lock); + + /* Disable migration when VHD images are used */ + error_set(&s->migration_blocker, + QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED, + "vpc", bs->device_name, "live migration"); + migrate_add_blocker(s->migration_blocker); + return 0; fail: @@ -788,6 +798,9 @@ static void vpc_close(BlockDriverState *bs) #ifdef CACHE g_free(s->pageentry_u8); #endif + + migrate_del_blocker(s->migration_blocker); + error_free(s->migration_blocker); } static QEMUOptionParameter vpc_create_options[] = { -- 1.7.11.7