]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Shared or readonly disks are always safe wrt migration
authorJiri Denemark <jdenemar@redhat.com>
Mon, 5 Mar 2012 11:10:21 +0000 (12:10 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 5 Mar 2012 14:24:00 +0000 (15:24 +0100)
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

index 84037e4eafc5d2f1e5affb1fc8f46c2528c665f5..5c4297c3b73c622267c0645c44fe3b7255d2c45d 100644 (file)
@@ -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;