mirror of https://github.com/xemu-project/xemu.git
vdi: Add migration blocker
vdi caches the block map. For migration to work, it would have to be invalidated. Block migration for now. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
fd9f102c3e
commit
fc9d106c8d
12
block/vdi.c
12
block/vdi.c
|
@ -52,6 +52,7 @@
|
||||||
#include "qemu-common.h"
|
#include "qemu-common.h"
|
||||||
#include "block_int.h"
|
#include "block_int.h"
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
|
#include "migration.h"
|
||||||
|
|
||||||
#if defined(CONFIG_UUID)
|
#if defined(CONFIG_UUID)
|
||||||
#include <uuid/uuid.h>
|
#include <uuid/uuid.h>
|
||||||
|
@ -203,6 +204,8 @@ typedef struct {
|
||||||
uint32_t bmap_sector;
|
uint32_t bmap_sector;
|
||||||
/* VDI header (converted to host endianness). */
|
/* VDI header (converted to host endianness). */
|
||||||
VdiHeader header;
|
VdiHeader header;
|
||||||
|
|
||||||
|
Error *migration_blocker;
|
||||||
} BDRVVdiState;
|
} BDRVVdiState;
|
||||||
|
|
||||||
/* Change UUID from little endian (IPRT = VirtualBox format) to big endian
|
/* Change UUID from little endian (IPRT = VirtualBox format) to big endian
|
||||||
|
@ -454,6 +457,12 @@ static int vdi_open(BlockDriverState *bs, int flags)
|
||||||
goto fail_free_bmap;
|
goto fail_free_bmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Disable migration when vdi images are used */
|
||||||
|
error_set(&s->migration_blocker,
|
||||||
|
QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED,
|
||||||
|
"vdi", bs->device_name, "live migration");
|
||||||
|
migrate_add_blocker(s->migration_blocker);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail_free_bmap:
|
fail_free_bmap:
|
||||||
|
@ -939,6 +948,9 @@ static int vdi_create(const char *filename, QEMUOptionParameter *options)
|
||||||
|
|
||||||
static void vdi_close(BlockDriverState *bs)
|
static void vdi_close(BlockDriverState *bs)
|
||||||
{
|
{
|
||||||
|
BDRVVdiState *s = bs->opaque;
|
||||||
|
migrate_del_blocker(s->migration_blocker);
|
||||||
|
error_free(s->migration_blocker);
|
||||||
}
|
}
|
||||||
|
|
||||||
static coroutine_fn int vdi_co_flush(BlockDriverState *bs)
|
static coroutine_fn int vdi_co_flush(BlockDriverState *bs)
|
||||||
|
|
Loading…
Reference in New Issue