No matter what cache mode is used, readonly disks are always safe wrt
migration. Shared disks are required to be readonly or to disable
host-side cache, which makes them safe as well.
---
src/qemu/qemu_migration.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 84037e4..5c4297c 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -828,10 +828,12 @@ qemuMigrationIsSafe(virDomainDefPtr def)
for (i = 0 ; i < def->ndisks ; i++) {
virDomainDiskDefPtr disk = def->disks[i];
- /* shared && !readonly implies cache=none */
+ /* Our code elsewhere guarantees shared disks are either readonly (in
+ * which case cache mode doesn't matter) or used with cache=none */
if (disk->src &&
- disk->cachemode != VIR_DOMAIN_DISK_CACHE_DISABLE &&
- (disk->cachemode || !disk->shared || disk->readonly)) {
+ !disk->shared &&
+ !disk->readonly &&
+ disk->cachemode != VIR_DOMAIN_DISK_CACHE_DISABLE) {
int cfs;
if ((cfs = virStorageFileIsClusterFS(disk->src)) == 1)
continue;
--
1.7.8.5