block: vhdx - add migration blocker
This blocks migration for VHDX image files, until the functionality can be supported. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
2fa9aa59cf
commit
5641bf4056
10
block/vhdx.c
10
block/vhdx.c
|
@ -20,6 +20,7 @@
|
||||||
#include "qemu/module.h"
|
#include "qemu/module.h"
|
||||||
#include "qemu/crc32c.h"
|
#include "qemu/crc32c.h"
|
||||||
#include "block/vhdx.h"
|
#include "block/vhdx.h"
|
||||||
|
#include "migration/migration.h"
|
||||||
|
|
||||||
|
|
||||||
/* Several metadata and region table data entries are identified by
|
/* Several metadata and region table data entries are identified by
|
||||||
|
@ -159,6 +160,7 @@ typedef struct BDRVVHDXState {
|
||||||
VHDXParentLocatorHeader parent_header;
|
VHDXParentLocatorHeader parent_header;
|
||||||
VHDXParentLocatorEntry *parent_entries;
|
VHDXParentLocatorEntry *parent_entries;
|
||||||
|
|
||||||
|
Error *migration_blocker;
|
||||||
} BDRVVHDXState;
|
} BDRVVHDXState;
|
||||||
|
|
||||||
uint32_t vhdx_checksum_calc(uint32_t crc, uint8_t *buf, size_t size,
|
uint32_t vhdx_checksum_calc(uint32_t crc, uint8_t *buf, size_t size,
|
||||||
|
@ -806,6 +808,12 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
|
||||||
|
|
||||||
/* TODO: differencing files, write */
|
/* TODO: differencing files, write */
|
||||||
|
|
||||||
|
/* Disable migration when VHDX images are used */
|
||||||
|
error_set(&s->migration_blocker,
|
||||||
|
QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED,
|
||||||
|
"vhdx", bs->device_name, "live migration");
|
||||||
|
migrate_add_blocker(s->migration_blocker);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
qemu_vfree(s->headers[0]);
|
qemu_vfree(s->headers[0]);
|
||||||
|
@ -952,6 +960,8 @@ static void vhdx_close(BlockDriverState *bs)
|
||||||
qemu_vfree(s->headers[1]);
|
qemu_vfree(s->headers[1]);
|
||||||
qemu_vfree(s->bat);
|
qemu_vfree(s->bat);
|
||||||
qemu_vfree(s->parent_entries);
|
qemu_vfree(s->parent_entries);
|
||||||
|
migrate_del_blocker(s->migration_blocker);
|
||||||
|
error_free(s->migration_blocker);
|
||||||
}
|
}
|
||||||
|
|
||||||
static BlockDriver bdrv_vhdx = {
|
static BlockDriver bdrv_vhdx = {
|
||||||
|
|
Loading…
Reference in a new issue