[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/12] vvfat: Add migration blocker
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 10/12] vvfat: Add migration blocker |
Date: |
Fri, 25 Nov 2011 19:12:13 +0100 |
vvfat caches more or less everything when in writable mode. For migration
to work, it would have to be invalidated. Block migration for now when
in writable mode (default is readonly).
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vvfat.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index 131680f..a310ce8 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -27,6 +27,7 @@
#include "qemu-common.h"
#include "block_int.h"
#include "module.h"
+#include "migration.h"
#ifndef S_IWGRP
#define S_IWGRP 0
@@ -350,6 +351,8 @@ typedef struct BDRVVVFATState {
array_t commits;
const char* path;
int downcase_short_names;
+
+ Error *migration_blocker;
} BDRVVVFATState;
/* take the sector position spos and convert it to Cylinder/Head/Sector
position
@@ -1073,6 +1076,15 @@ DLOG(if (stderr == NULL) {
// assert(is_consistent(s));
qemu_co_mutex_init(&s->lock);
+
+ /* Disable migration when vvfat is used rw */
+ if (s->qcow) {
+ error_set(&s->migration_blocker,
+ QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED,
+ "vvfat (rw)", bs->device_name, "live migration");
+ migrate_add_blocker(s->migration_blocker);
+ }
+
return 0;
}
@@ -2829,6 +2841,11 @@ static void vvfat_close(BlockDriverState *bs)
array_free(&(s->directory));
array_free(&(s->mapping));
g_free(s->cluster_buffer);
+
+ if (s->qcow) {
+ migrate_del_blocker(s->migration_blocker);
+ error_free(s->migration_blocker);
+ }
}
static BlockDriver bdrv_vvfat = {
--
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, 2011/11/25
- [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 <=
- [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