]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Do not report unsafe migration for local files
authorJiri Denemark <jdenemar@redhat.com>
Thu, 11 Apr 2013 16:28:35 +0000 (18:28 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 11 Apr 2013 19:57:50 +0000 (21:57 +0200)
When migrating a domain with disk images stored locally (and using
storage migration), we should not complain about unsafe migration no
matter what cache policy is used for that disk.

src/qemu/qemu_migration.c

index a263668a8dde0c263883d2d33c12d249c48463fc..a31bd022f0ce45dd851fb67acd9ed87d141f62e9 100644 (file)
@@ -1477,13 +1477,17 @@ qemuMigrationIsSafe(virDomainDefPtr def)
             !disk->shared &&
             !disk->readonly &&
             disk->cachemode != VIR_DOMAIN_DISK_CACHE_DISABLE) {
-            int cfs;
+            int rc;
 
             if (disk->type == VIR_DOMAIN_DISK_TYPE_FILE) {
-                if ((cfs = virStorageFileIsClusterFS(disk->src)) == 1)
+                if ((rc = virStorageFileIsSharedFS(disk->src)) < 0)
+                    return false;
+                else if (rc == 0)
                     continue;
-                else if (cfs < 0)
+                if ((rc = virStorageFileIsClusterFS(disk->src)) < 0)
                     return false;
+                else if (rc == 1)
+                    continue;
             } else if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK &&
                        disk->protocol == VIR_DOMAIN_DISK_PROTOCOL_RBD) {
                 continue;