From 07dd6fb61077d0987e471549ffd9a418f7cfe78a Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Mon, 5 Mar 2012 12:10:21 +0100 Subject: [PATCH] qemu: Shared or readonly disks are always safe wrt migration 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 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 84037e4eaf..5c4297c3b7 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; -- 2.47.2