[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/12] vdi: Add migration blocker
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 07/12] vdi: Add migration blocker |
Date: |
Fri, 25 Nov 2011 19:12:10 +0100 |
vdi caches the block map. For migration to work, it would have to be
invalidated. Block migration for now.
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vdi.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/block/vdi.c b/block/vdi.c
index 684a4a8..7dda522 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -52,6 +52,7 @@
#include "qemu-common.h"
#include "block_int.h"
#include "module.h"
+#include "migration.h"
#if defined(CONFIG_UUID)
#include <uuid/uuid.h>
@@ -203,6 +204,8 @@ typedef struct {
uint32_t bmap_sector;
/* VDI header (converted to host endianness). */
VdiHeader header;
+
+ Error *migration_blocker;
} BDRVVdiState;
/* 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;
}
+ /* 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;
fail_free_bmap:
@@ -939,6 +948,9 @@ static int vdi_create(const char *filename,
QEMUOptionParameter *options)
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)
--
1.7.6.4
- [Qemu-devel] [PULL 00/12] Block patches for 1.0, Kevin Wolf, 2011/11/25
- [Qemu-devel] [PATCH 01/12] virtio-blk: fix cross-endian config space, Kevin Wolf, 2011/11/25
- [Qemu-devel] [PATCH 02/12] usb-msd: do not register twice in the boot order, Kevin Wolf, 2011/11/25
- [Qemu-devel] [PATCH 04/12] scsi-generic: add as boot device, Kevin Wolf, 2011/11/25
- [Qemu-devel] [PATCH 03/12] scsi: fix fw path, Kevin Wolf, 2011/11/25
- [Qemu-devel] [PATCH 05/12] sheepdog: Avoid deadlock in error path, Kevin Wolf, 2011/11/25
- [Qemu-devel] [PATCH 06/12] qcow: Add migration blocker, Kevin Wolf, 2011/11/25
- [Qemu-devel] [PATCH 07/12] vdi: Add migration blocker,
Kevin Wolf <=
- [Qemu-devel] [PATCH 08/12] vmdk: Add migration blocker, Kevin Wolf, 2011/11/25
- [Qemu-devel] [PATCH 10/12] vvfat: Add migration blocker, Kevin Wolf, 2011/11/25
- [Qemu-devel] [PATCH 12/12] vpc: Add missing error handling in alloc_block, Kevin Wolf, 2011/11/25
- [Qemu-devel] [PATCH 11/12] vdi: Fix memory leak, Kevin Wolf, 2011/11/25
- [Qemu-devel] [PATCH 09/12] vpc: Add migration blocker, Kevin Wolf, 2011/11/25
- Re: [Qemu-devel] [PULL 00/12] Block patches for 1.0, Anthony Liguori, 2011/11/28