[libvirt] [PATCH] qemu: Do not report unsafe migration for local files

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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a263668..a31bd02 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -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; -- 1.8.1.5

On 04/11/2013 10:32 AM, Jiri Denemark wrote:
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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Apr 11, 2013 at 11:47:03 -0600, Eric Blake wrote:
On 04/11/2013 10:32 AM, Jiri Denemark wrote:
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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
ACK.
Pushed, thanks. Jirka
participants (2)
-
Eric Blake
-
Jiri Denemark